I have the following code:
UIWebView.loadRequest(NSURLRequest(URL: NSURL(string: "google.ca")))
I am getting the following error:
'NSURLRequest' is not convertible to UIWebView.
Any idea what the problem is?
I have the following code:
UIWebView.loadRequest(NSURLRequest(URL: NSURL(string: "google.ca")))
I am getting the following error:
'NSURLRequest' is not convertible to UIWebView.
Any idea what the problem is?
UIWebView in Swift
/////////////////////////////////////////////////////////////////////// if you want to use webkit
loadRequest: is an instance method, not a class method. You should be attempting to call this method with an instance of UIWebview as the receiver, not the class itself.
However, as @radex correctly points out below, you can also take advantage of currying to call the function like this:
For swift 4.2, 5+
For Swift 3.1 and above
Swift 3
Swift 3 - Xcode 8.1