Is iOS UIWebView based on Safari implementations like Android WebView on Chromium? - ios

I'm searching now for a while but I've not found a solid statement on an apple developer site about the underlying implementation of the UIWebView.
Does anybody know that?

Apple introduced WKWebView in iOS8. This implementation replaces UIWebView and brings with it the same javascript engine that Safari on iOS uses. The old UIWebView was not as responsive as Safari as it had an older implementation of the javascript engine and leaked memory.
There is a great article on NSHipster about it, http://nshipster.com/wkwebkit/

Related

how can I know if a web api is supported by WKWebView?

I am a web frontend developer and working on buildiing webview pages in hybrid app for the first time.
I was considering Page Visibility API and trying to find out if it is supported by webview browsers, like WKWebView and Android Webview, and couldn't find informations about WKWebView support.
I know there is a safari on iOS tab in caniuse.com, but I am not sure if it means WKWebView supports the same.
so I want to know
if safari on iOS supports something, does it mean WKWebView supports the same?
if not, where can I find informations about WKWebView support?
thank you in advance.

What is the browser used by cordova on iOS?

I understand that Android uses the WebView which is based on Chromium (from version 4.4), Does cordova on iOS uses Safari or something else?
Safari for iOS is using WebKit2 (starting from iOS 8).
Details about WebKit2.
This seems to answer to your question.
This plugin makes Cordova use the WKWebView component instead of the default UIWebView component, and is installable only on a system with the iOS 9.0 SDK.
UIWebView is a part of WebKit.
cordova apps use the UIWebView component to load the apps, it's based on safari (WebKit2) but it doesn't include the Nitro javascript engine (the one safari app uses), so your cordova apps will be slower than safari app executing the same code.
Once cordova 4.0 is out, it will include "plugable webviews", that means, you will be able to choose which webview to use from any of the webviews available on the SDK (right now UIWebView and WKWebView)
If you can't wait for cordova 4.0, you can use the WKWebView plugin
WKWebView is based on safari too, but it uses the Nitro javascript engine, so it's as performant as safari app
Here you can read a full article about the comparison between UIWebView and WKWebView
The main difference is, as I mentioned before, WKWebView uses the Nitro javascript engine that is faster than the one used on the UIWebView,
and WKWebview supports IndexedDB and ObjectStore ArrayBuffer.
CSS compability and rendering is the same for UIWebView, WKWebView and safari app

Corona SDK native WebView browsers

What browser is using Corona SDK for the native WebView?
I presume for iOS it is using an Objective C WebView which should use Safari, and for Android it's using Chrome, but I haven't been able to find any reference to it.
I don't know abut Android But iOS UIWebView is not safari that is sure.
You can rad some difference here : UIWebView and Safari comparison
One more article about this : Apple confirms some WebKit optimizations unavailable to iOS Apps
iOS 8 give new WebView named WKWebView One good article about this is here : NSHipster : WKWeb​View
But I don't know that Corona is going to use WKWebView or not.

Mobile Safari uses Webkit1/Webkit2?

I am researching a bit about Mobile safari and have searched the web for any information about the process model being used.
Webkit1 was a single process framework and with Webkit2 the chromium style multi-process model was introduced in Webkit. But no where is there a mention of Mobile Safari using the same.
Is there anyway to detect which Webkit(1/2) is being used in the latest Mobile Safari? Is there any changelog of the same?
I'm not sure in my answer, but there is a private framework called WebKit2.framework in iOS7. You can check it here.
So, it's quite possible, that Safari uses WebKit2.

UIWebView and Safari comparison

Does UIWebView use the same JavaScript engine as Mobile Safari?
Also, does UIWebView support all HTML5 features like Mobile Safari does? I am specifically concerned about Web SQL and Web Workers
If I have an app which is written purely in HTML and JS, should I wrap it up in a UIWebView or should I have it open in Mobile Safari
Are pure HTML and JS apps accepted on the Apple store?
Does UIWebView use the same JavaScript engine as Mobile Safari?
UIWebView does not have the Nitro Javascript engine, so it executes JS slower than Mobile Safari. So it's not the same.
Also, does UIWebView support all HTML5 features like Mobile Safari does? I am specifically concerned about Web SQL and Web Workers
Not sure about this one. Probably not. At least UIWebView is a bit more strict than Safari on certain features. Example: when setting a width/height style through JS, you need to add 'px' behind the number, while Mobile Safari does not require that.
If I have an app which is written purely in HTML and JS, should I wrap it up in a UIWebView or should I have it open in Mobile Safari
If you want to release the app on the App Store, you will have to wrap it. If not, you don't really have to.
Are pure HTML and JS apps accepted on the Apple store?
If you wrap it, yes. But it has some limitations, as James Webster wrote.
See this question here on SO for more information on the differences between UIWebView and Safari.
I can only really provide insight to part 4 of your question with these snippets:
There are a few guidelines in the App Store Review guidelines (requires login) that mention "web"
2.12 Apps that are not very useful, are simply web sites bundled as apps, or do not provide any lasting entertainment value may be rejected
2.17 Apps that browse the web must use the iOS WebKit framework and WebKit Javascript
12.3 Apps that are simply web clippings, content aggregators, or a collection of links, may be rejected

Resources