luowei / LWWebUI

LWWebUI,基于WKWebView的WebView容器组件与Web控制器组件,包含 LWWKWebViewController & LWWKWebView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libLWWebUI

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

if(@available(iOS 11.0,*)){

    dispatch_group_t group = dispatch_group_create();

    //删除所有cookie,再添加
    [[[WKWebsiteDataStore defaultDataStore] httpCookieStore] getAllCookies:^(NSArray<NSHTTPCookie *> *cookies) {
        for(NSHTTPCookie *cookie in cookies){
            dispatch_group_enter(group);
            [[[WKWebsiteDataStore defaultDataStore] httpCookieStore] deleteCookie:cookie completionHandler:^{
                dispatch_group_leave(group);
            }];
        }
    }];

//        dispatch_group_async(group, dispatch_get_current_queue(), ^{
//        dispatch_group_async(group, dispatch_get_main_queue(), ^{
    dispatch_group_notify(group, dispatch_get_main_queue(), ^{
        [self setupCookies];
        LWWKWebViewController *webVC = [LWWKWebViewController wkWebViewControllerWithURL:[NSURL URLWithString:@"http://wodedata.com/index.php/blog"]];
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:webVC];
        [self presentViewController:nav animated:YES completion:nil];
    });

} else{
    [self setupCookies];
    LWWKWebViewController *webVC = [LWWKWebViewController wkWebViewControllerWithURL:[NSURL URLWithString:@"http://wodedata.com/index.php/blog"]];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:webVC];
    [self presentViewController:nav animated:YES completion:nil];
}

Requirements

Installation

libLWWebUI is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LWWebUI'

Carthage

github "luowei/LWWebUI"

Author

luowei, luowei@wodedata.com

License

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

About

LWWebUI,基于WKWebView的WebView容器组件与Web控制器组件,包含 LWWKWebViewController & LWWKWebView.

License:MIT License


Languages

Language:HTML 51.2%Language:Objective-C 46.2%Language:Ruby 1.4%Language:Shell 1.2%