1
votes

My structure is:

ViewController A [-> (modal)] Navigation Controller -> ViewController B [-> (push)] ViewController C

In other words: VC A has a button you push to do a modal segue to VC B (which happens to be embedded in a Navigation Controller).

Then in VC B, you click on a table view cell and this triggers a push segue to VC C. All segues were made on the storyboard and identifiers were appropriately named.

The Issue is: When you click on the table view cell that transitions from VC B to VC C, the transition does correctly go to VC C, but it animates like a modal segue and VC C does not have a navigation bar (even when I specifically set navigationController?.isNavigationBarHidden = false). Thus, there is no back button.

For debugging purposes, I embedded VC A in a nav controller and had a button from there segue to a new VC with the push segue and the same thing happened (that thing being that the transition did not spawn the nav bar). Any ideas to solve this issue?

EDIT: Basic idea of the VC setup. Note that segue from VC A to VC B is done in code.

VC Setup

2
Can you try embedding VC C in a navigation controller as well then segue to that - ACerts
Hey thanks for the suggestion! I just tried that, but it didn't work. I also tried deleting and setting the segue up again after embedding VC C in a nav controller, but it didn't seem to change anything. - Aloysius
No problem my friend. When you set up the new segue did you segue to the nav controller or to VC C directly? - ACerts
I don't understand your question clearly, if you can upload your image of storyboard i think it is better than to solve this - seyha
@ACerts I set it up both ways and both didn't work. I assume it's supposed to be to the nav though, right? - Aloysius

2 Answers

2
votes

To fix this you need to connect the modal segue from VC A to VC B’s Navigation Controller.

0
votes

In VC A you should present navigation controller of VC B. And then in VC B (not its navigation controller) you should connect segue to VC C directly no need to embed navigation controller for VC C. you will get back button after you connected.