TimOliver / TOWebViewController

A view controller class for iOS that allows users to view web pages directly within an app.
http://www.timoliver.com.au/2014/07/27/towebviewcontroller-an-open-source-web-viewer-for-ios/
Other
1.48k stars 211 forks source link

Added WKWebView support #36

Closed proxyblue closed 8 years ago

proxyblue commented 10 years ago

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.

fulldecent commented 10 years ago

Confirming this looks good

TimOliver commented 10 years ago

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.

dkhamsing commented 10 years ago

Nice work @fulldecent (would resolve #17)

TimOliver commented 9 years ago

Hrmmm... I've been thinking about this one a bit more, and I've got a few points of concern:

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? :)

TimOliver commented 8 years ago

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!