How do I make the activity indicator stop only when the web page appears?
Your object can become delegate
for webView
to listen to -webViewDidFinishLoad
delegate method. So:
- (void)viewDidLoad {
// Create the UIWebView
UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
webView.delegate = self; // Here is the key
...
}
...
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[self.view viewWithTag:100].hidden = YES;
}
You may also implement -webViewDidStartLoad:
to show activity indicator instead of showing it in -viewDidLoad
method.
How do I add words to the activity indicator like "Loading"?
You should create a separate UILabel
, there is no way to add text to standard UIActivityIndicatorView