UIWebView is the basic control for displaying Web pages in iOS, providing a very simple and efficient way to use them.
First of all, to build a UIWebView Iboutlet in storyboard now, and associate with Viewcontroller.
Then there is the code execution process:
WebView is connected to storyboard var webview:uiwebview!
First set the WebView style, such as webview!. frame = self.view.framewebview!. BackgroundColor = Uicolor.graycolor ()//Add WebView to Self.view, and then load URLRequest. Self.view.addSubview (webView) var url = "http://www.dianping.com" urlrequest = Nsurlrequest (Url:nsurl (string:url)!) webview!. Loadrequest (URLRequest)
You can then display the specified Web page on the view.
In addition, there are a number of more advanced features, such as the advanced features of WebView, adding more navigation to the web, and so on. Not recorded for the time being, then fill it up later.
UIWebView---iOS controls for displaying Web pages