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.


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.

Update (2018-08-01): Howard Oakley:

When WebViews are lost from macOS, a great many older apps will still expect to find them, and you should expect their behaviour to be untoward at least. I suspect that will kill far more apps than any future requirement for them to be 64-bit. And there’s no easy way to discover which apps are dependent on WebView.

Update (2018-08-10): Shazron Abdullah:

There are many limitations of WKWebview, especially if you were using UIWebView previously. The limitations are:

  1. Cookies don’t persist. This is a WebKit bug, but someone has created a plugin for a workaround. See CB-12074
  2. Can’t delete cookies. This is/was a WebKit bug (2015), we need to test for the iOS 11/12. See CB-11297
  3. Can’t execute JavaScript code in the background. There are several issues related to this. See CB-12815
  4. XmlHttpRequests don’t work, because of Cross-Origin Resource Sharing issue (CORS). There is a workaround plugin created by Oracle (UPL licensed, which is Apache-2.0 compatible). See CB-10143
  5. Migration of localStorage from UIWebView. There is a migration plugin available. See CB-11974
  6. iframes will not be supported any longer (they are now CORS restricted in WKWebView), and may be partially or completely broken. This may lead to incompatibilities with the same code in other Cordova platforms.
  7. Known issues with WKWebView on iOS pre-11 which will be deprecated and dropped in a future Cordova release

There are several bugs that need to be resolved as well. The full list here:

Update (2018-11-26): See also: Core Intuition.

Update (2019-06-14): Brady Eidson:

It’s been a year since we formally deprecated UIWebView and WebView.

They’re still in iOS 13 and macOS Catalina but are still going away in future releases.

We’ve gathered tons of great feedback in the last year, but want even more.


I was expecting to see massive improvements to [QuickTime X] before [QuickTime 7] was deprecated...
I was expecting to see massive improvements to [Photos] before [iPhoto] was deprecated...
I was expecting to see massive improvements to [Apple Maps] before [Google Maps] was deprecated...
I was expecting to see massive improvements to [the Safari App Extensions API] before [the Safari Extensions API] was deprecated...
I was expecting to see massive improvements to [USB-C] before [everything else] was deprecated...

...but that doesn’t seem to be happening.

I was expecting to see massive improvements to [Swift] before [Objective-C] was deprecated...
I was expecting to see massive improvements to [UIKit/Marzipan] before [AppKit] was deprecated...
I was expecting to see massive improvements to [iOS] before [macOS] was deprecated...

@vintner I actually do think most, if not all, of those examples have seen steady improvements that add up. And it’s not as if there was an Aperture API that lots of apps relied on. In fact, the API for Photos is better than what we had before.

@Michael Definitely not when it comes to the Safari Extensions.

For video APIs, I'm a bit dubious considering all the current incoherencies in movie playback on High Sierra when it comes to the new video formats.

@someone I’m not saying there’s parity with the Safari Extensions, but they do keep expanding what you can do with the new style extensions.

One piece of good news from the Safari session is that WebKit will be getting support for Service Workers. Given that Windows and Chrome already have support, hopefully that means fewer Electron-based desktop webapps in the future.

@vintner That comment is extremely aesthetically pleasing and semantically horrifying.

I was expecting to see massive improvements to [UIKit/Marzipan] before [AppKit] was deprecated...

I'll be gobsmacked if the official Marzipan release next year has any more Mac idioms/affordances than this year's four Marzipan apps exhibited in the first beta.

I'm glad I didn't know about XmlHttpRequests being broken. That might have dissuaded me from using them in my app where they work fine.

[…] there are a lot of limitations related to the use of WKWebView, well documented in a Michal Tsai article; we are going to mention the most important for […]

UIWebView was working perfectly in offline mode, but can't make it work in WKWebView. Any suggestion?

Deprecating objective-c is a death trap for any Adobe, Autodesk, MICROSOFT, and other large cross platform product.

Why don’t you people get that?

@Devboy Did you mean to post that comment on one of the SwiftUI posts? I don’t see how it applies here.

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment