As mentioned in the title, I'm looking out for the way to detect all of the UIWebViews has finished load that are loading HTML string simultaneously.
I have one custom view in which there are 5 web views (1 for question and 4 for options). Each of them loading html string as :
[queWV loadHTMLString:queHtml baseURL:nil];
[opt1WV loadHTMLString:opt1Html baseURL:nil];
[opt2WV loadHTMLString:opt2Html baseURL:nil];
[opt3WV loadHTMLString:opt3Html baseURL:nil];
[opt4WV loadHTMLString:opt4Html baseURL:nil];
I've tried checking this with webViewDidFinishLoad
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
if(webView == opt4WV)
{
//All web views has finished loading
}
}
But practically, its incorrect as the webViewDidFinishLoad method is getting called for random web views, depending on contents to load.
Is there any way to detect load finish for all the web views ?
Thanks !
Maybe I'm oversimplifying or not seeing something, but did you try to use webViewDidFinishLoad in a combination with the counter? So if you have 5 web views, implement a counter from 1 to 5 and count how many times does webViewDidFinishLoad get's called. When you get to 5 all views are loaded.