IOS network analysis-(12 UIWebView Introduction), iosuiwebview
In this article, we only need to know what UIWebView is.
UIWebView is a UI control provided by Apple to display webpages. It is also the most memory-occupied control.
After iOS8.0, A webkit framework emerged. WKWebView saves 1/4 ~ compared with UIWebView ~ 1/3 of memory, fast, but no cache function.
For some shopping app web pages, it is essential to display them. Therefore, UIWebView is also a space for us to be proficient in singing.
The following is a brief introduction to UIWebView.
/// ViewController. m // CX-UIWebView /// Created by ma c on 16/3/23. // Copyright©2016 xubaoaichiyu. all rights reserved. // # import "ViewController. h "@ interface ViewController () <UIWebViewDelegate> @ property (nonatomic, strong) UIWebView * webView; @ end @ implementation ViewController-(void) viewDidLoad {[super viewDidLoad]; // initialize webView _ webView = [[UIWebView alloc] initWithFrame: CGRectMake (0, 20, self. view. frame. size. width, CGRectGetHeight (self. view. frame)-60)]; NSURL * url = [NSURL URLWithString: @ "http://www.baidu.com"]; [_ webView loadRequest: [NSURLRequest requestWithURL: url]; // Add webView to View [self. view addSubview: _ webView];}/*-(void) reload; refresh-(void) stopLoading; stop load-(void) goBack; Return-(void) goForward; forward */@ end