teh_raab
teh_raab

Reputation: 394

Tab Bar Controller missing on subsequent View Controllers

I have the following Storyboard Layout in an iOS project:

enter image description here

The layout is setup so that:

Worth noting that in the future there will be two additional View Controllers linked from the bottom of F that can both link back to G.

The issue is that the F and G View Controllers do not show the tab bar. They do however still show the navigation bar on the top.

I did try to embed the E (left most) View Controller in its own Navigation Controller and F and G did then display the tab bar, however it was then showing a secondary navigation bar and back navigation seemed to get messed up/ out of sync.

I feel as though iIam staring right at the solution but currently drawing a blank and so would appreciate any ideas or pointers in the right direction before i go completely bald

Update after help from Glenn..

I have made progress. For whatever reason I embedded the first tab in its own Navigation controller and then recreated the segues and the bottom bar is appearing this time. I think last time I didn't remove the segues before embedding the tab so may be an IDE or refactoring issue.

Either way, progress but I am still seeing an issue with the back button as I were seeing the original attempt. Pressing back on F is now returning to B instead of E. I think this is because back is still using the Navigation controller A.

Upvotes: 0

Views: 518

Answers (2)

Glenn Posadas
Glenn Posadas

Reputation: 13283

What you're missing (and the only way to fix it, I believe) is embedding your E controllers into a new UINavigationController. So each E has different navigationController. Otherwise the F & G and other controllers that will be pushed by your E (without its own navigationController) will use the navigationController of your tabBarController, which is still good.

I did make a sample project to test it and I almost forgot that this is how this kind of flow should be. I use the same kind of screen hierarchy/structure.

Just remember to handle the transition (popping and dismissal) of your F and G related screens.

enter image description here

Upvotes: 1

Ankur Lahiry
Ankur Lahiry

Reputation: 2315

Uncheck Hide Bottom Bar on Push for F & G ViewControllers may solve your issue.

enter image description here

Upvotes: 0

Related Questions