I have a app where users can connect with numerous websites. I have a UINavigationController that displays all the websites. It will push when the user taps on into a webView in a different view controller.
This all is fine, but when the user is done, how can the UIViewController communicate with the app and tell it to pop back one? I have compete control of the php files in the webView, so it should be easy, right?
I was thinking about getting the title from the javascript file every time it loads. If it’s a special, then go back? What would be the best way in doing this?
I haven’t been able to find anything on the internet. If you could just point me in the right direction, that would be fantastic!
Thanks,
Coulton
I’m unsure what you mean by “when the user is done” – do you mean when the user has finished viewing the selected webpage and wants to go back to the list?
If so, you already will have pushed your
UIViewControlleron to theUINavigationControllerwhich is not much more than a stack ofUIViewControllerinstances. EveryUIViewControllerhas anavigationControllerproperty which isniluntil the view controller is pushed onto a navigation controller.With that in mind, try calling:
[self.navigationController popViewControllerAnimated:yesOrNo]where
selfshould be the view controller you want to pop.