Home   →   Blog   →   Beginner's Guide: Modern Apple WebKit Framework

Beginner's Guide: Modern Apple WebKit Framework

The newest release of the WebKit framework in iOS8 provided significant simplification of iOS development process. 

The previous version of iOS allowed to useUIWebViews based on UIKit framework. The biggest disadvantage of this implementation related to In-Process loading of web content. Plus UIWebViews didn't contain Javascript Nitro engine optimization, that vastly improved speed of interpreting scripts and led to compilation of JavaScript code into native machine code. One more additional disadvantage of UIWEbView was that many web kit capabilities were not shared with developers. So believe me, Javascript bridging looked like a pain. However, new WebKit framework contains a list of the new features like smooth scrolling, gestures, key-value observing of new WKWebView’s properties, native communication.

The first of them was achieved by exploiting Core Animation and hardware acceleration providing 60 fps. As for gestures, now WKWebViews supports track-pad gestures such as swipe to go back and pinch to zoom. Go further, to check exact status of the web view at any given time such properties of WKWebView as progress, title, URL can be observed by KVO. Native JS Bridging becomes possible with the help of new APIs: UserScripts and ScriptMessages. The first allows developer to inject JavaScript code into a webpage and run it on a specific part of a page. The second one enables the native code to receive callbacks (like NSNotification) from the User Scripts injected into the page.

The crucial achievement of WebKit is that every single web content of WKWebView runs in its own process completely isolated from our app. And its processes are handled by the system. It improves responsiveness of App when web pages load a lot of JS objects and run a lot of scripts. It gives an opportunity to put individual web pages for things like background tabs and fully-occluded Windows.

And finally new WKNavigationAction class offers protocol methods which is called multiple times by the loading of a web page. Property navigationType determines the type of action triggering the navigation. We can track the loading process and tweak it according to the needs of Application.

Summary: Modern WebKit framework provides developers with the opportunity to build powerful, modern and responsive apps using web contents.

If you have any specific questions on possible implementation of these features in your product feel free to contact us by this Contact form.

Next Posts
1ab000fbd6a1796435389b4321ab227e090cc832 Android Widgets
Android widgets are small applications that can be embedded in other applications such as the home screen or the lock screen view.
B6f5624783b518bf5dfa75db4ea4dac743862338 The New Apple TV
With the release of the new Apple TV running on tvOS users get a chance to play games, use applications, watch movies and share their experiences.
2ccd5f6748b1661dae6b35fbd3ccc9a7e8f92ec6 Apple Pay
Apple Pay was announced on WWDC 2014 by Tim Cook. It is a mobile payment service by Apple. It lets you buy goods or services by a single touch (with Touch ID). And it is amazing!
Notice Our website uses cookies, which are necessary for its functioning and required to achieve the purposes illustrated in the privacy policy. By closing this banner you agree to the use of cookies.