I want to make a simple app, where a UIWebView with custom content will have several links to other pages with similar content as well (and a navigation bar on top, with just a back button).
I read the answers to this question, however I’m not sure if I should do that in my application, as the user might be able to go deep enough, and I will be creating new webviews all the time.
What could be the best practice for such a behavior?
Thank you!
I’d recommend listening for:
and always returning YES (so the webView will continue with the requested link) while storing each request in an
NSMutableArrayto create a stack of the user’s browsing history.That would let you update a back button’s text with the previous page’s title (shortened of course).
If you just need to have a back button without label, you could have a simple button hooked up to the UIWebView’s
- (void) goBack;method.