WebBrowser

A web browser using WebKit and written in Swift for iOS apps.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

50

Maintenance

Last Commit

2yrs ago

Contributors

4

Package

Dependencies

0

License

MIT

Categories

Readme

WebBrowser

A web browser using WebKit and written in Swift for iOS apps.

Example

How To Get Started

Carthage

Specify "WebBrowser" in your Cartfile:

github "teambition/WebBrowser"

CocoaPods

Specify "WebBrowser" in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'WebBrowser'

Usage

Initialization

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/")

Pushing to the navigation stack

navigationController?.pushViewController(webBrowserViewController, animated: true)

Presenting modally

let navigationWebBrowser = WebBrowserViewController.rootNavigationWebBrowser(webBrowser: webBrowserViewController)
present(navigationWebBrowser, animated: true, completion: nil)

Implement the delegate

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
}

Minimum Requirement

iOS 8.0

Localization

WebBrowser supports 5 languages: English, Simplified Chinese, Traditional Chinese, Korean, Japanese. You can set the language when initialization.

Release Notes

License

WebBrowser is released under the MIT license. See LICENSE for details.

More Info

Have a question? Please open an issue!

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100