I have 2 WebViews in my application. one is loading a youtube video and the other is loading an events calendar. I want to show a custom ‘Loading’ image until the data from the web views are done loading.
I am trying
while([youtubeView isLoading]){
NSLog(@"youtubeVideo is loading");
[loadingImage setHidden:NO];
}
[loadingImage setHidden:YES];
In viewDidLoad but it doesn’t work.
Whats the best way to accomplish what I am trying to achieve?
Cheers, Beers on me.
Use below method of UIWebViewDelegate. It get called once webView finish loading.
Also note that your class need to conform to UIWebViewDelegate and both your webviews should set delegate equal to object of that class.
inside method where you create UIWebView youtubeView
Beer ?