0

In my app i am presenting UITabbarcontroller as a modal view controller. There are 3 tabs and i have assigned a UInavigationcontroller to each tab. Now the problem is if i am tapping an already selected tab, it is working as popViewControllerAnimated function of UInavigationcontroller.

UITabBarController *custom = [[UITabBarController alloc] init];
custom.delegate = self;
custom.tabBar.backgroundImage = [UIImage imageNamed:@"footerbar.png"];
[custom setViewControllers:[NSArray arrayWithObjects:nav, nav1, nav2, nil]];
[[UITabBar appearance] setItemWidth:(self.view.frame.size.width/3)-15];
[[NSUserDefaults standardUserDefaults] setObject:@"yes" forKey:@"loggedIn"];
[self presentViewController:custom animated:NO completion:nil];

I am really stuck at the moment. Need advice here.

Virat Naithani
  • 783
  • 12
  • 31

1 Answers1

0

This is the UITabBarController behaviour, to prevent this please check the link

Prevent automatic popToRootViewController on double-tap of UITabBarController

Community
  • 1
  • 1
Muneeba
  • 1,756
  • 10
  • 11