Add/Remove or Show/Hide tab bar items from UITabbarController when using storyboards

ios, uitabbarcontroller, xcode

Solution

You can remove a tabbar item as follows:

NSMutableArray *tabbarViewControllers = [NSMutableArray arrayWithArray: [self.tabBarController viewControllers]];
[tabbarViewControllers removeObjectAtIndex: /*Any index*/];
[self.tabBarController setViewControllers: tabbarViewControllers ];

Problem

I have an application that needs to show different content from a `UITabBarController` based on if the user is registered or not. Is there a way to add and remove `ViewController`s from a `UITabBarController` at run-time? Show and Hide would be fine too. Prior to storyboards you could call `setViewController` but that does not seem to be the right way when using stoaryboards.

Original source