UIWebView will continue to work with existing applications. WKWebView is available starting with iOS8 , only WKWebView has a Nitro JavaScript engine.
To use this faster JavaScript engine in older applications, you need to make code changes to use WKWebView instead of UIWebView . For iOS7 and older, you should continue to use UIWebView , so you may need to check iOS8 and then apply the WKWebView delegate methods / methods and return to the UIWebView methods for iOS7 and older. There is also no Interface Builder component for WKWebView (yet), so you need to programmatically implement WKWebView .
You can implement WKWebView in Objective-C, here is a simple example to run WKWebView :
WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init]; WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:theConfiguration]; webView.navigationDelegate = self; NSURL *nsurl=[NSURL URLWithString:@"http://www.apple.com"]; NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl]; [webView loadRequest:nsrequest]; [self.view addSubview:webView];
WKWebView rendering performance is noticeable in WebGL games and something that runs complex JavaScript algorithms, if you use webview to load a simple html or website, you can continue to use UIWebView .
Here is an app test that can be used to open any website using UIWebView or WKWebView , and you can compare the performance, and then decide to upgrade the application to use WKWebView : https://itunes.apple.com/app/id928647773?mt = 8 & at = 10ltWQ

krisrak Oct 25 '14 at 4:34 2014-10-25 04:34
source share