I'm trying to cache specified web pages to disk by NSURLProtocol,now I can only get the first URL request, but the UIWebView spawns further URL requests for loading graphics. So how can I Intercept all the requests spawned by UIWebView from the first URL? Thank you very much!
Implement delegate method
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
every time your webview loads url it will first call this method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With