I would like to know for sure, when a page load is finished in UIWebView
. I am aware of the "refcounting" approach between didStartLoad
/didFinishLoad
outlined in here and it kinda-sorta works for me, but i don't feel very confident about it. It has grown some hairy ifs
and still acts strangely when Javascript decides to talk into document.location
. I am unclear namely about the following:
UIWebViewDelegate
for all the power it should handle, is very terse and has next to none documentation. Can anyone confirm thatdidStartLoad
/didFinishLoad
is really called only for "frames" which means most probably "frameset/frame" and "iframe" ?- how can i distinguish the above DOM-induced loads from request redirections (which produce the events too)?
- my observation is that each
didStartLoad
is preceded withshouldStartLoadWithRequest
, except redirections. Is this a dependable behavior? - am i missing something, or is there no way of knowing what request has originated the particular
didStartLoad
? Because[[webView request] URL]
of the only context given, is always returning the same URL, that is the one which UIWebView was asked to load initially.