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.

comments powered by Disqus
Cf68cdaaf75f9cd1417267c6b1cafb3813c488a1 Virtual Reality Applications
Augmented reality apps are widely used – from geolocalization to using it in gaming industry. Augmented reality app is a new way to access data determined by environment conditions.
754d17aa02f8c56a0e0b671d45bf2455f6177062 Agile Methodology (Scrum)
Scrum is the very popular agile methodology for managing product development and project delivery. Scrum is the framework that could be applied for the development of product use cases, different projects or entire products.
1a1b621bfd24aba09a56bb25cf18719ad46ef190 News App Development
Smartphones are regularly used everywhere & anytime: in cars, on the way to the office, during the rest on holidays or weekends. That’s very convenient way for users to access important or just fun information with the help of news mobile app.
D63ac21dfd17c4acc93d52d9bdc72fea10e84edd Geolocation Services in Mobile Tracking Software
Geolocation services are used by many mobile apps, websites, mobile operators etc.