A web browser using WebKit and written in Swift for iOS apps.
Specify "WebBrowser" in your Cartfile
:
github "teambition/WebBrowser"
Specify "WebBrowser" in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'WebBrowser'
let webBrowserViewController = WebBrowserViewController()
// assign delegate
webBrowserViewController.delegate = self
webBrowserViewController.language = .english
webBrowserViewController.tintColor = ...
webBrowserViewController.barTintColor = ...
webBrowserViewController.isToolbarHidden = false
webBrowserViewController.isShowActionBarButton = true
webBrowserViewController.toolbarItemSpace = 50
webBrowserViewController.isShowURLInNavigationBarWhenLoading = true
webBrowserViewController.isShowPageTitleInNavigationBar = true
webBrowserViewController.customApplicationActivities = ...
webBrowserViewController.loadURLString("https://www.apple.com/cn/")
navigationController?.pushViewController(webBrowserViewController, animated: true)
let navigationWebBrowser = WebBrowserViewController.rootNavigationWebBrowser(webBrowser: webBrowserViewController)
present(navigationWebBrowser, animated: true, completion: nil)
func webBrowser(_ webBrowser: WebBrowserViewController, didStartLoad url: URL?) {
// do something
}
func webBrowser(_ webBrowser: WebBrowserViewController, didFinishLoad url: URL?) {
// do something
}
func webBrowser(_ webBrowser: WebBrowserViewController, didFailLoad url: URL?, withError error: Error) {
// do something
}
func webBrowserWillDismiss(_ webBrowser: WebBrowserViewController) {
// do something
}
func webBrowserDidDismiss(_ webBrowser: WebBrowserViewController) {
// do something
}
iOS 8.0
WebBrowser supports 5 languages: English, Simplified Chinese, Traditional Chinese, Korean, Japanese. You can set the language when initialization.
WebBrowser is released under the MIT license. See LICENSE for details.
Have a question? Please open an issue!