ZLCWebView
github地址 : 源文件地址
1、将项目中的根目录中的“ZLCWebView源文件”中的ZLCWebView.h及m拖入工程(或直接在项目中拖出)
//在目标视图内初始化
ZLCWebViewZLCWebView *my = [[ZLCWebViewalloc]initWithFrame:self.view.bounds]; [myloadURLString:@"http://www.baidu.com"]; my.delegate = self; [self.viewaddSubview:my];
//让视图遵守ZLCWebView的delegate并实现ZLCWebView的delegate
- (void)zlcwebViewDidStartLoad:(ZLCWebView *)webview {NSLog(@"页面开始加载"); }
- (void)zlcwebView:(ZLCWebView *)webview shouldStartLoadWithURL:(NSURL*)URL {NSLog(@"截取到URL:%@",URL); }
- (void)zlcwebView:(ZLCWebView *)webview didFinishLoadingURL:(NSURL*)URL {NSLog(@"页面加载完成"); }
- (void)zlcwebView:(ZLCWebView *)webview didFailToLoadURL:(NSURL*)URL error:(NSError*)error {NSLog(@"加载出现错误"); }