I'm using a new view to display different web pages. I've added the UIWebView to my view and linked the delegate with the controller and the web view with an Outlet. Then I've added the following code to the controller
class WebPageController: UIViewController, UIWebViewDelegate {
@IBOutlet weak var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL (string: "www.google.co.uk")
let requestObj = NSURLRequest(URL: url!)
webView.loadRequest(requestObj)
}
When I run the app and go to this page, the page appears blank, what have I missed?
You need to add http://
with your url like this.
let url = NSURL (string: "http://www.google.co.uk")