Hacker News new | ask | show | jobs
by geon 5090 days ago
How would you handle the UIWebView networking yourself? THe UIWebView is really opaque, doing everything by itself.

I guess you could download the HTML externally and get it into the view through loadHTMLString:baseURL: , but that would still make the UIWebView load all images etc.

2 comments

You can replace the global NSURLCache with a custom implementation, and trap all the connections in there. We use it to replace online resources with resources we've prepackaged in the bundle when possible.
You can register a NSURLProtocol to handle networking requests for UIWebView. Some applications use this to provide transparently decrypted local files to a UIWebView.