I have the following code:
UIWebView.loadRequest(NSURLRequest(URL: NSURL(string: \"google.ca\")))
I am getting the following error:
In Swift 3 you can do it like this:
@IBOutlet weak var webview: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Web view load
let url = URL (string: "http://www.example.com/")
let request = URLRequest(url: url!)
webview.loadRequest(request)
}
Remember to add permission at Info.plist, add the following values: