iOS app also has a period of time, in the previous demo has not had the opportunity to use WebView, today to check the gaps, use a webview. The earliest contact with WebView is in Android, and the use of WebView in iOS is quite simple. This blog does not have any advanced technology, but the application of WebView. Literally you can see that WebView is the view used to load a Web page, similar to a browser on a phone.
1. Before using storyboard to drag the control only to see where WebView lie quietly (as shown), has not been used, if you want to use it is also very simple, is to drag the Web view into the storyboard can: write a blog today to apply:
2, drag the WebView into the storyboard, and associated with the associated code, as follows:
Code Description:
(1). Create a Nsurlrequest
(2). Load Nsurlrequest with Mywebview
3.webView of the principal-agent model is also very simple, such as the next,
(1), Shouldstartloadwithrequest: Called when the URL is requested
(2), Webviewdidstartload: Called when the Web page starts to load
(3). Webviewdidfinishload: Called when the Web page finishes loading
(4). Didfailloadwitherror: Load failed call
4. After the successful loading, the effect is as follows:
iOS Development WebView