Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone: Check if current viewcontroller is on moreNavigationController

I have run across this where I need to know whether my current viewcontroller is on moreNavigationController or it is a tab item. Basically I want to hide TabBar for some of my screens and giving choice to user to move back to homescreen(ideally previous screen) using left navigation button! If my view controller is on moreNavigationController then I can simply popViewControllerAnimated:YES and it will go back to More screen but when it is Tab item then I need to change the selected tab index.

Is there anyway to know whether current view controller is on moreNavigationController?

Thanks.

like image 278
AlienMonkeyCoder Avatar asked Jan 25 '12 17:01

AlienMonkeyCoder


1 Answers

I don't have a project to test it on, but I think this might do it.

BOOL isOnMore = ([self.tabBarController.moreNavigationController.viewControllers containsObject:self]);
like image 121
NJones Avatar answered Sep 17 '22 22:09

NJones