I want to make two tab bar controllers.
One for group A and the other for group B.
How to branch them?
Can I get some hints?
I think this will work if you are not using Storyboard. (Not sure how to do it if you are using Storyboard.)
in AppDelegate define global variables
UITabBarController *tabBarController1;
UITabBarController *tabBarController2;
then in didFinishLaunchingWithOptions;
tabBarController1=[[UITabBarController alloc] init];
tabBarController1.delegate=self;
tabBarController2=[[UITabBarController alloc] init];
tabBarController2.delegate=self;then somewhere and certainly execute before leaving didFinishLaunchingWithOptions:
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if(groupAIsBeingDisplayed){
window.rootViewController = tabBarController1;
}else{
window.rootViewController = tabBarController2;
}
[window makeKeyAndVisible];