Archive for June 20, 2018

Wednesday, June 20, 2018 [Tweets] [Favorites]

WebView and UIWebView Deprecated in Favor of WKWebView

Brady Eidson:

I hope most of you have heard the news by now, but UIWebView has been formally deprecrated.

That means it is going away altogether in a future release.

Please start adopting WKWebView now, and please ping me directly with any issues that arise.

(Same goes for WebView on Mac)

The separate process architecture is nice, but this is going to be a rough transition. It looks like WKWebView is still missing tons of features from WebView (Web archives, DOM, customized loading and display, probably more that I haven’t discovered yet). The limitations are so severe that I bet a lot of apps haven’t even looked much into switching. Other features will be possible to port, but the API is very different, and in many cases you’ll need to switch from Swift/Objective-C to JavaScript. I was expecting to see massive improvements to WKWebView before WebView was deprecated, but that doesn’t seem to be happening.

See also: What’s New in Safari and WebKit.

Previously: WKWebView Workarounds, WKWebView, Sandboxing, and Searching, WKWebView.

Update (2018-06-20): The WWDC session has no useful information about switching to WKWebView, and the presenter implies that it’s easy.

Steve Harris:

As @mjtsai the inability to create web archives is a problem for me (and adding iOS support would be great), while printing / saving PDFs doesn’t work at all on Mac

Matt Curtis:

On the subject, is there a way to invoke copy from a WKWebView while preserving rich text? I tried a while back and it doesn’t seem to work using the usual UIResponder methods.

Isaiah:

My main income is Stack for Rapidweaver. The vast majority of the UI handled by manipulating the DOM directly.

That is not possible in a WKWebView.

If WebView is removed my business will die and strand thousand of customers.

the issue is that they’ve cut off most of the fast APIs.

this was, i’m sure, done to improve security and avoid content policy injection.

unfortunately it really limits the utility of the view.

it’s basically just a web page viewer now.

Update (2018-06-23): See also: Core Intuition.

Update (2018-06-24): David Dunham:

I tried using it but got random crashes and went back to UIWebView.

Daniel Jalkut:

We who rely upon WebView DOM manipulation really have our work cut out for us. We have to at least file the bugs with Apple and hope for accommodations where we need them.