I have a Navigation Controller app and I’m using this code to switch views:
- (IBAction)switchPage:(id)sender
{
if(self.fourthViewController == nil)
{
FourthViewController *fourthView = [[FourthViewController alloc]
initWithNibName:@"FourthView" bundle:[NSBundle mainBundle]];
self.fourthViewController = fourthView;
[fourthView release];
}
[self.navigationController pushViewController:self.fourthViewController animated:YES];
}
However I want to have a button that can go to an alternate view that is a UIWebview, My goal is to not leave the app so when user is done on the web page, the navigation controller never goes away and they can proceed to the next view.
Does anyone know of a tutorial that can help?
Why not use a modal view? Here’s an example from one of my apps. So whats going on below is that I assign a credits bar button item on the nav controller nav bar which when clicked brings up the modal view controller which presents a webview. Really rather simple:
There are many ways to get back to the main view. I implemented a “back” button on the webview which dismisses the modal view controller: