UIWebView vs WKWebView
1. UIWebView? WKWebView?
* According to iOS version, AppleWebKit version change...
iOS 7.1 : 537.51.2
iOS 8.1 : 600.1.4 (WKWebView Class added)
- UIWebView Class exist in UIKit Framework
|
UIWebView |
WKWebView |
Framework |
UIKit |
WebKit |
Support Storyboard | Yes | No |
- Add Object library in Storyboard
- Coding
* case (UIWebView)
* case (WKWebView)
- Delegate API differences are...
UIWebView |
WKWebView |
didFailLoadWithError |
didFailNavigation |
webViewDidFinishLoad |
didFinishNavigation |
webViewDidStartLoad |
didStartProvisionalNavigation |
shuldStartLoadWithRequest |
decidePolicyForNavigationAction |
2. Benchmark Comparison analysis
* test rendering application : https://itunes.apple.com/app/id928647773?mt=8
| UIWebView (iOS 7.1, iPad 2) | UIWebView (iOS 8.1, iPad Air) | WKWebView (iOS 8.1, iPad Air) |
HTML5 | 410/555 | 427/555 WebGL 3D support | 440/555 WebGL 3D / IndexedDB support |
CSS3 | 56% | 61% | 61% |
JavaScript | 4139.8ms | 3509.8ms | 405.2ms |
ECMAScript Compatibility (Link) | 2% | 28% | 28% |
WebGL 2D (CPU uses about 850 particles) | 98% | 94% | 18% |
WebGL 3D | NOT support | Crashed | 13frame |
3. Issues
- file:// don't work without tmp directory
- Can't handle in Storyboard and Interface Builder
- HTML a tag with target="_blank" won't respond
- URL Scheme and App Store link won't work
- NSCachedURLResponse won't work
- NSHTTPCookieStorage wont't work
- Can't coexist with UIWebView on iOS 7 and below