Search code examples
swiftuinavigationcontrolleruinavigationbarsegueuitoolbar

Relationship between Push Segues, Navigation controllers, and Tool/Nav Bars


enter image description here

So above I have a picture of my current storyboard and I have a few questions to clarify my understanding:

1) Am I correct to assume when I do a push segue way from my first VC to my second VC that my second VC would be on top of the stack?

2) Would there be any reason at all to embed another Navigation Controller in my second VC? Or would it be redundant.

3) As I wanted both my Navigation and Toolbars to show on my second VC when the push segue happened I made both my Top and Bottom Bars Translucent, is there a better way to do this?

4) How would I be able to access the bottom toolbar of the second VC? I know that I can access the navigation bar via self.navigationController?.navigationBar but I can't seem to find a way for the bottom toolbar.


Solution

    1. Yes
    2. It would likely be redundant. It's possible that it may be useful as a child view controller but that's unlikely and would probably lead to unexpected things in future.
    3. That's fine (unless it isn't working / looking correct for the user)
    4. I see why Q3 now. That option is for when the view controller is inside a tab bar controller for example, and used to help with the space available for layout. If you want an explicit toolbar on the view then you should explicitly add it as a sub-view.