In the end, after playing with the settings, I managed to get it to work. I'm not sure why it works now and has not worked before, so I will be grateful for your comments.
Storyboard:
- Check as βHide bottom panel on clickβ for the custom view controller.
- Mark as marked "Show toolbar" for the navigation controller
Code:
On the button, click the hide / unhide tabBar button: [self.tabBarController.tabBar setHidden:state]
It almost works. It hides / displays the tabBar when the button is clicked, but the only problem is that the tabBar is initially hidden when switching tabs. I had to make extra efforts to make it visible.
Set UITabBarControllerDelegate to display tabBar when switching tabs. I did this in a regular SUSourceTabController :
- (void)viewDidLoad { [super viewDidLoad]; self.delegate = self; } - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController: (UIViewController *)viewController { [self.tabBar setHidden:NO]; }
We also need to display it for the first tab type in the code of the custom controller view. Using setHidden:NO anywhere else in the code did not help.
- (void)viewDidLoad { [super viewDidLoad]; [self.tabBarController.tabBar setHidden:NO]; }
source share