reboot_brain
reboot_brain

Reputation: 51

push segue won't draw UITabBarController, but modal segue will. Am I missing something?

I have been pouring over this site for hours trying to find an answer to this issue, but have been unable to resolve it. The problem is as follows:

I have a UITableViewController that uses a push segue to push a UITabBarController onto the stack. The UITabBarController has relationships with 4 UITableViewControllers.

When I change the segue to modal, the first UITableViewControllers associated with the UITabBarController displays as expected, except of course without the Navigation Bar. When I select push segue, the issue is reversed: the navigation bar appears with the proper name of the UITabBarController and the custom buttons I created...but neither the tab bar nor the contents of the first tab display - just black.

Is there something special I need to do to get the contents of the UITabBarController to display when a push segue is used?

I've tried embedding one of the UITableViews that the UITabBarController is related to in a UINavigationController, but that made no difference.

The basic structure of my current app is:

UIView->(modal segue)->UINavigationController->(relationship)->UITableViewController->(push segue)->UITabBarController->(relationship)[4 UITableViewControllers)

Thanks!

Upvotes: 0

Views: 1303

Answers (1)

sensslen
sensslen

Reputation: 780

Well actually Apple encourages Users not to use UITabbarcontroller in a Navigationcontroller. One simply doesn't do that. That's why you get this wired behavior. Try to redesign your App so that this is no longer necessary or otherwise use modal Segue and create a new Navigationcontroller in Tabbarcontroller.

There's also a third option to create a custom Tabbarcontroller, but I personally wouldn't do that because it is not intended to be done by Apple either and it's quite a bit of Work.

There may be some other solutions but I didn't find anything simple enough to try out, so I used modal Segue in my App...

Upvotes: 0

Related Questions