README.md

TOWebViewController

An Inline Web Browser for iOS Apps

TOWebViewController is an open-source UIViewController subclass designed to let apps quickly present web page content to its users, without needing to kick them over to Safari. TOWebViewController has been designed from the ground up to be easily integrated into existing projects, to take advantage of the latest features of iOS, and to optionally be backwards compatible with (significantly) earlier versions of iOS.

Features

Powered by UIWebView, backwards compatible down to iOS 5.

Full navigation buttons set, including back, forward, refresh and an optional share/action button.

Detects whether being pushed modally, or via a navigation controller and adjusts the UI accordingly.

As a CocoaPods Dependency

As a Carthage Dependency

Manual Installation

Download this project from GitHub, move the subfolder named 'TOWebViewController' over to your project folder, and drag it into your Xcode project.

After that, you'll need to link the following system frameworks to your project:

QuartzCore.framework

CoreGraphics.framework

MessageUI.framework

Twitter.framework

Why no WKWebView adoption?

While WKWebView does look much nicer than UIWebView, it has several show-stopping issues. Most importantly, session and cookie data that is created inside a WKWebView isn't accessible by the rest of the Foundation framework. Since a large goal in building this project was to allow users to log into web accounts and subsequently use that session to download files, this is simply unacceptable.

TOWebViewController will not be adopting WKWebView at any point in the future. If you would like an alternative view controller that does, please give DZNWebViewController a try!

What about SFSafariViewController?

Starting from iOS 9, Apple now provides a built-in web view controller of similar functionality named SFSafariViewController. If your app is only targeting iOS 9, and it completely fills your requirements, then it is absolutely recommended that you adopt SFSafariViewController instead of TOWebViewController.

That being said, if you are still targeting lower iOS versions, or require more customisability than SFSafariViewController provides, then TOWebViewController can still serve as a viable alternative.

Credits

TOWebViewController was originally created by Tim Oliver as a component for iComics, a comic reader app for iOS.

Thanks also goes to TOWebViewController's growing list of contributors!