Closed proxyblue closed 8 years ago
Confirming this looks good
Haha thanks for that!
I'm currently waiting until after I've released the latest build of my app before merging in this one as I want to do a proper review on it, to make sure it's still backwards compatible with some of the UIWebView
stuff I integrated at the request of some other developers.
Nice work @fulldecent (would resolve #17)
Hrmmm... I've been thinking about this one a bit more, and I've got a few points of concern:
WKWebView
solves a LOT of things on its own that I was hacking away with on UIWebView
; so much so that if you ran a WKWebView
-powered version of TOWebViewController
on iOS 8, a LOT of the code in there would be redundant and would never get used.WKWebView
doesn't store its state information (like cookies etc) in your app's container. As a result, for example, if you used a WKWebView
to log into an online service, those login credentials wouldn't be available to you if, you wanted to use ,say an NSURLSession
to download something requiring that login This is a huge showstopper for me.As a result, it looks like there's still a bit of life left in UIWebView
on iOS 8 after all, as there are a lot of legitimate, non-trivial use cases that wouldn't work with WKWebView
.
As a result, I'm now considering keeping TOWebViewController
as a purely UIWebView
powered view controller, and making a new class, TOWKWebViewController
that is designed from scratch to make full use of WKWebView
and not have to deal with any of the UIWebView
cruft. Ideally, all common code that both classes could share (Such as the device rotation code) could be moved into their own, shareable objects.
This would also solve some compatibility issues, since I know of a few shipping apps that use TOWebViewController
and are directly accessing the webView
property for JS purposes, and trying to replace that with WKWebView
on the fly could be really messy.
Anyone here have any objections to that? :)
Closing this PR since I'm opting to stick with UIWebView
for this particular class due to the fact I need access to the cookie/session data that WKWebView
otherwise disallows.
If you ARE after a WKWebView
powered web view controller, definitely check out https://github.com/dzenbot/DZNWebViewController. :)
Or just use SFSafariViewController
where possible.
Sorry Louis!
Added WKWebView support for all devices running iOS 8. If the class exists, it will try to use it. If people want this functionality off, they will need to change the #define of WKWEBVIEW_NSCLASS to 0
Future work could involve additional configuration information if people are interested - that would involve completely reallocating the UIWebView. Doable if requested.