I'm working on an iOS app, and I need to prevent a UIButton from being usable until the page has finished loading (it uses resources that might not be on the page until it has loaded completely.)
Right now, I've disabled the button in Interface Builder and am trying to use setEnabled in the webViewDidFinishLoad function. Here's what it looks like:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[activityIndicator stopAnimating];
[randomButton setEnabled:YES];
}
The activityIndicator stops animating and hides as expected, so I know the page is loading fully. However, the button remains disabled.
How can I enable that button after the webView finishes loading?