How to switch one tabBarController to another in iOS
How to switch the primary tab (containing five Views) to the secondary tab (containing the other five Views) in iOS:
-(Void) makeTabBarHidden :( BOOL) hide
{
If ([self. rootTabBarController. view. subviewscount] <2 ){
Return;
}
UIView * contentView;
If ([[self. rootTabBarController. view. subviewsobjectAtIndex: 0] isKindOfClass: [UITabBarclass]) {
ContentView = [self. rootTabBarController. view. subviewsobjectAtIndex: 1];
} Else {
ContentView = [self. rootTabBarController. view. subviewsobjectAtIndex: 0];
}
If (hide ){
ContentView. frame = self. rootTabBarController. view. bounds;
}
Else {
ContentView. frame = CGRectMake (self. rootTabBarController. view. bounds. origin. x,
Self. rootTabBarController. view. bounds. origin. y,
Self. rootTabBarController. view. bounds. size. width,
Self. rootTabBarController. view. bounds. size. height-self. rootTabBarController. tabBar. frame. size. height );
}
Self. rootTabBarController. tabBar. hidden = hide;
}