Para cambiar el user agent de una UIWebView en iOS tan solo tenemos que usar el siguiente código:
NSDictionary *dictionario = [[NSDictionary alloc] initWithObjectsAndKeys:@»Mi user agent personalizado», @»UserAgent», nil];[[NSUserDefaults standardUserDefaults] registerDefaults:dictionario];
UIWebView* webViewTemporal = [[UIWebView alloc] initWithFrame:CGRectZero];NSString* userAgent = [webViewTemporal stringByEvaluatingJavaScriptFromString:@»navigator.userAgent»];
UIWebView* webViewTemporal = [[UIWebView alloc] initWithFrame:CGRectZero];NSString* userAgent = [webViewTemporal stringByEvaluatingJavaScriptFromString:@»navigator.userAgent»];NSString * miUserAgentPersonal = [NSString stringWithFormat:@»Mi app %@»,userAgent];
NSDictionary *dictionario = [[NSDictionary alloc] initWithObjectsAndKeys:miUserAgentPersonal, @»UserAgent», nil];[[NSUserDefaults standardUserDefaults] registerDefaults:dictionario];