How to present view controller embedded in navigation controller modally?

19,579

Refer to this answer here, Option 2: Presenting ViewController with NavigationController

Simply, you need to embed a navigationController into vc3 and then present the navigation controller modally. You will need to create your own back button though.

Share:
19,579
Prabhu
Author by

Prabhu

Updated on June 04, 2022

Comments

  • Prabhu
    Prabhu almost 2 years

    Say I have these view controllers: Navigation Controller -> vc1 -> vc2 -> vc3

    I want vc3 to show modally (appear form the bottom), so I selected the "Present Modally" option on the segue between vc2 and vc3. However, what happens is that my navigation bar on vc3 gets hidden, and also when I close vc3, it transitions weirdly--it pops back down (what you would expect from a modal view), and then also slides back left (as if a back button was pressed).

    So what is the right way to present modally? Do I need to put vc3 in it's navigation controller?