Giter Site home page Giter Site logo

webbrowser's Introduction

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!

webbrowser's People

Contributors

hongxinhope avatar horexc avatar wzxha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.