Building a Browser in 10 Minutes with UIWebView
Martha M.
2 posts
|
We are starting an iPhone programming club at our high school and I was wondering if someone could give us some coding example on how the busy indicator could be implemented in the Web Browser example. Below taken from the prelease chapter sample on “READING DATA FROM THE NETWORK_ “could also add a “busy” indicator to indicate when the view is loading a page by providing a delegate that implements the UIWebViewDelegate protocol, which provides the callbacks webViewDidStartLoad:, webView- DidFinishLoad: and webView:didFailLoadWithError:.” Thanks for any help you are able to give us. Martha |
Chris Adamson
82 posts
|
Sure. As you work through the examples more, the pieces will probably become pretty self-evident to you. Just to see how much more it would take, I took a copy of the 10 minute browser and added the activity indicator. Here’s the steps to follow (pretty loose and informal, as this is a forum and not the book itself!)
And that’s it. Now when you click the “Go” button, the activity indicator appears and starts spinning. When the web page is finished loading, the spinner disappears. Your users are happy you’ve given them visual feedback as to what the app’s doing. If you walk through this, let me know if you think I’ve missed anything… |
Martha M.
2 posts
|
Thanks! It worked like a charm. The students were very excited because now they can use it in the project they are working on. |
Chris Adamson
82 posts
|
Glad to hear they’re off and running! BTW, I probably should have taken out the NSLog()s, which were just there for debugging (I often start an event-handling method with NSLog and the method name, just to make sure it’s getting called at all). |
4 posts, 2 voices
