How can I have a UIWebView load a file that is really an HTML file but has it’s extension changed to .wxyz ? However there are a group of files that contain hyperlinks between the files. The hyperlinks in the documents point to files with the .html extension.
So, what I need to have happen is for the UIWebView to recognize that .wxyz == .html and will open the file and when a link like this is clicked <a href="myHTML.html">A Link</a> will open the file myHTML.wxyz .
Should I subclass UIWebView? Or is there another way to do this?
All of these .wxyz files will be contained within the app and not on a server.
I think you can do this with
UIWebViewDelegate webView:shouldStartLoadWithRequest:navigationType:– just detect requests for html that also have a wxyz resource equivalent, return NO, and make a request for the wxyz type instead. The code below should give the gist of it: