0
votes

I have the following Storyboard Layout in an iOS project:

enter image description here

The layout is setup so that:

  • A is the Navigation Controller
  • B is an Intro Video (nav bar hidden as its a full screen video)
  • C is the Terms & Conditions (nav bar displayed to show title)
  • D is a Tab Bar Controller (Home Screen, with nav bar displayed form here on out with app logo)
  • E are five home screen tabs
  • F & G are two View Controllers that can be launched from the first tab (E)

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.

2
Sorry, i don't have a test project. I am using push segues for B to C & D, C to Dand E to F and G. The links seen between A -> B and D to the E's are relationships. I hope this makes sense.teh_raab
How are you doing the E to F/G? again? PerformSegue?Glenn Posadas
Correct. performSegue withIdentifierteh_raab
In that case, the best thing you could do (and is the ideal way FOR ME) is to make the B present the C and D. I've done lots of production iOS projects using this kind of flow, even in my current full-time job, this is how I do the whole flow.Glenn Posadas
Try this. This is the code of my Main.Storyboard. You could just create a new project. Open Main.Storyboard as Source Code, then paste this gist: gist.github.com/glennposadas/4103ea81f435529cec760ca93a773997Glenn Posadas

2 Answers

1
votes

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

0
votes

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

enter image description here