I have an app where users can navigate a pile of locally stored HTML files. I have a UIWebView
, configured up correctly with a UIWebViewDelegate
. Usually, when the user follows a link, shouldStartLoadWithRequest
is called, followed by webViewDidFinishLoad
a bit later.
But, if the link is pointing to an anchor on the same page as the one which is currently displayed, only shouldStartLoadWithRequest
is called. webViewDidFinishLoad
does not fire.
In a sense, I see that this might be expected behaviour, because in-page navigation should not require a page reload. However, I really need a place to hook into the call stack after in-page navigation is complete. The optimal solution would let me know when any sort of navigation has ended, both from another page, in-page and forward/backward actions.
My best hackaround so far has been to call performSelector: withObject: afterDelay:
at the end of my shouldStartLoadWithRequest
method, but I'm not happy with this.
Does anyone know how I can solve this correctly? Any insight appreciated!