Skip to content

LSRain/LSWebView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LSWebView

Encapsulate the WKWebView and quickly browse the web(Web container. WKWebView, UIWebView package)

Introduction

This is a tool wrapper from WKWebView that you can use to quickly load Url resources

How to use

First initialize

// >>>>>>> init Model >>>>>>
LSWebObj *webObj = [LSWebObj new];
webObj.title = @"Test Title";
webObj.url = @"https://www.baidu.com";
self.title = webObj.title;

LSWebView *my = [[LSWebView alloc]initWithFrame:self.view.bounds];
[my loadURLString:webObj.url];
[self.view addSubview:my];
my.delegate = self;

And then implement its protocol

#pragma mark - this is LSWebViewDelegate

- (void)lswebViewDidStartLoad:(LSWebView *)webview{
    NSLog(@"The page starts loading...");
}

- (void)lswebView:(LSWebView *)webview shouldStartLoadWithURL:(NSURL *)URL{
    NSLog(@"Intercept to URL:%@",URL);
}

- (void)lswebView:(LSWebView *)webview didFinishLoadingURL:(NSURL *)URL{
    NSLog(@"The page is loaded!");
}

- (void)lswebView:(LSWebView *)webview didFailToLoadURL:(NSURL *)URL error:(NSError *)error{
    NSLog(@"Loading error!");
}

More

轮子之LSWebView(WKWebView封装)

Thanks

Some implement logical references from ZLCWebView.

About

Encapsulate the WKWebView and quickly browse the web(Web container. WKWebView, UIWebView package)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published