剑客
关注科技互联网

PFWebViewController:轻量级的 WKWebView 封装和实现

PFWebViewController

Features

  • A light-weight webview controller using WKWebView. Only supports iOS 9 and above.

  • Easy use and less memory consuming thanRxWebViewController.

  • Support Safari-like reader mode.

Screenshots

Loading

PFWebViewController:轻量级的 WKWebView 封装和实现

Main Screen

PFWebViewController:轻量级的 WKWebView 封装和实现 PFWebViewController:轻量级的 WKWebView 封装和实现

Reader Mode

PFWebViewController:轻量级的 WKWebView 封装和实现 PFWebViewController:轻量级的 WKWebView 封装和实现

Installation

Using Carthage

Add PFWebViewController to your Cartfile :

github "PerfectFreeze/PFWebViewController"

Run carthage to build this framework.

Add PFWebViewController.framework to your Xcode project.

Using CocoaPods

Add PFWebViewController to your Podfile :

pod 'PFWebViewController', '~> 1.1.1'

Run pod install to install this framework.

Manually

Drag Classes folder to your project.

Usage

// Init with a string
PFWebViewController *webVC = [[PFWebViewController alloc] initWithURLString:@"https://github.com"];

// Or with an URL
NSURL *url = ...;
PFWebViewController *webVC = [[PFWebViewController alloc] initWithURL:url];

// Optional: Set Progressbar's Color, default is black
[webVC setProgressBarColor:[UIColor redColor]];

// Present in a single view
[self presentViewController:webVC animated:YES completion:nil];

// Or push in a navigationController
[self.navigationController pushViewController:webVC animated:YES];

Further Reading

License

This project is released under the terms and conditions of the MIT license . SeeLICENSE for details.

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址