0

I have a Tab Bar Controller with 4 Items. In the 4 one I included a webView with some links. One of the links is a PDF, if I open a PDF in the webView there is no way to go back to the main webView with the links. Is there a way by re-clicking the 4. TabBar to reload the View? If I change from the 3. to the 4. tabbar it works (viewWillAppear). ![enter image description here][1]

Thanks in advance for your help.

joelschmid
  • 828
  • 1
  • 16
  • 32

2 Answers2

0

There is a method in UITabBarDelegate called:

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item; 

You could use that to also catch touches of the selected tab bar item.

Mundi
  • 79,884
  • 17
  • 117
  • 140
0

Try with this method of (UITabBarControllerDelegate):

(maybe something like this)

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
        //Try this if you're pushing the webView in another ViewController
        [viewController.navigationController popToRootViewControllerAnimated:YES];
        //or access to your webView and call goBack();
}
Mat
  • 7,613
  • 4
  • 40
  • 56