IPhone UIWebView Return Button

I am trying to make the back button in my navigation bar because I already have a tab bar at the bottom of the screen.

my layout is this:

tab bar[ navigation bar { webview () } ] 

essentially. I need to programmatically add a back button and it seems I can’t figure out how to do this. I know there is a goBack method, but I do not know very well how to implement this.

I already have a button that brings up an action plan with several options, but how can I use the goBack method?

as I understand it, I can also use something like

 if (mywebview canGoBack) { [mywebview goBack] } 

but I'm not sure how to do this.

any help?

+7
source share
1 answer

Somewhere in the delegation file of your action sheet, you should have a method similar to this:

 -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { // if the first option is selected, whatever it may be... (counting starts at zero)) if ([myWebView canGoBack]) { [myWebView goBack]; } } else return; } 
+18
source

All Articles