Change agent-agent
2 answers
If you want to set the User-Agent HTTP header for your request to be used to load into the webview,
let userAgent = "Custom User Agent";
let myURL = NSURL(string: "http://http://web-example")
let myURLRequest:NSURLRequest = NSMutableURLRequest(URL: myURL!)
myWbView.loadRequest(myURLRequest)
myURLRequest.setValue(userAgent, forHTTPHeaderField: "User-Agent")
If you want to set User-Agent for all requests in your application see this question How to set "User-Agent" header of UIWebView in Swift
+2
source to share