- API is identical on OS X and iOS.
- Uses the fast Nitro JS engine on iOS (unlike
UIWebView), including fourth tier LLVM JIT.
WKWebViewhas its own process(es), separate from the main app process.
- Each page gets its own process up to an unspecified limit, at which point pages start sharing processes.
WKWebViewConfigurationclass encapsulates all configuration so that it can be shared among multiple instances of
- Properties (
estimatedProgress) are KVO-compliant.
Customizing Page Loading
- Hook into page loading, page actions, and network responses using methods in the
allowsBackForwardNavigationGesturesproperty enables left/right swipe gestures for navigation.
NSScrollViewfor double tap and pinch to zoom.
UIScrollViewdoes this automatically with no additional configuration.
Customizing Webpage Content
WKWebViewConfiguration) to inject user scripts into web pages and register handlers for script messages.
- User scripts (see
WKUserScript) are scripts written in JS and are generally used to modify the DOM.
- Debugged using the Safari web inspector.
- Script messages (see
WKScriptMessage) are sent as JSON from the web page to your app and are automatically converted into Objective-C types.
The modern WebKit API, including
WKWebView and all associated classes are part of the open source WebKit project. The source code for these classes can be found here.