[IOS/研究]UIWebView拦截[近期完成,待续]

拦截位置在于以下UIWebViewDelegate下的函数方法
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;

  • 点击拦截
    NSURL *requestURL = request.URL;
    if (([[requestURL scheme] isEqualToString: @"http"] ||
    [[requestURL scheme] isEqualToString: @"https"] ||
    [[requestURL scheme] isEqualToString: @"mailto"]) &&
    (navigationType == UIWebViewNavigationTypeLinkClicked))
    {
    NSLog(@"点击拦截");
    return false;
    }

你可能感兴趣的:([IOS/研究]UIWebView拦截[近期完成,待续])