iUI is cool, but UIWebView Navigation Controller is better
Thanks to Ben Gotow for this excellent iPhone class allowing for a webview with an associated Navigation Controller:
http://www.gotow.net/creative/wordpress/?p=16
The DrillDownWebController maintains a “stack” of DrillDownPages, with each page representing a single layer in the drill-down hierarchy. A DrillDownWebController can be a root level controller, or it can be loaded into an existing UINavigationController. When it appears, it silently swaps its parent’s navigation bar with it’s own and loads the first page.
The DrillDownPage is a wrapper for a UIWebView that acts as its delegate and provides higher-level access to important properties of the page, such as it’s title. I decided to pull this functionality out of the controller because it reduced confusion when multiple UIWebViews were being loaded. When the user clicks a link in the top level web view, a new DrillDownPage object is created and it begins loading the requested page in an invisible UIWebView. The controller locks the current page and displays an activity indicator in the top right corner of the navigation bar. When loading is complete, it animates a slide to the new page and updates the navigation bar. All the other pages in the page “stack” are notified that their position in the drill-down hierarchy has changed.
