Skip to content

简易封装 WKWebView 的 iOS 应用内置浏览器。A drop-in inline browser used WKWebView for your iOS app.

License

Notifications You must be signed in to change notification settings

dawnnnnn/DNWKWebViewController

Repository files navigation

DNWKWebViewController

Version License Platform

DNWKWebViewController is a simple inline browser for your app.

This library is derived from SVWebViewController, which tries to build a webview controller with WKWebView.

DNWKWebViewController

DNWKWebViewController features:

  • iPhone and iPad distinct UIs
  • full landscape orientation support
  • back, forward, stop/refresh and share buttons
  • Open in Safari and Chrome UIActivities
  • navbar title set to the currently visible web page
  • talks with setNetworkActivityIndicatorVisible
  • propress view support

Installation

CocoaPods

platform :ios, '8.0'
pod 'DNWKWebViewController'

Manually

  • Drag the DNWKWebViewController/DNWKWebViewController folder into your project.
  • #import "DNWKWebViewController.h"

Usage

(see sample Xcode project in /Demo)

Just like any UIViewController, DNWKWebViewController can be pushed into a UINavigationController stack:

DNWKWebViewController *webViewController = [[DNWKWebViewController alloc] initWithAddress:@"http://oopser.com"];
[self.navigationController pushViewController:webViewController animated:YES];

DNWKWebViewControllerActivity

Starting in iOS 6 Apple uses UIActivity to let you show additional sharing methods in share sheets. DNWKWebViewController comes with "Open in Safari" and "Open in Chrome" activities. You can easily add your own activity by subclassing DNWKWebViewControllerActivity which takes care of a few things automatically for you. Have a look at the Safari and Chrome activities for implementation examples. Feel free to send it as a pull request once you're done!

Change Log

  • 0.0.4 :
    • Fix bugs
  • 0.0.3 :
    • Fix bugs
    • update scroll decelerationRate
  • 0.0.2 :
    • Remove progressView when dealloc
  • 0.0.1 :
    • Released first version

License

DNWKWebViewController is available under the MIT license. See the LICENSE file for more info.

About

简易封装 WKWebView 的 iOS 应用内置浏览器。A drop-in inline browser used WKWebView for your iOS app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published