Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Nick Sint
Nick Sint
4,208 Points

Navigation controller stack and Modal Views

Hi all,

I am currently building an app whereby all the view controllers (vc1, vc2, vc3 etc...) are in a navigation controller thus are all in the navigation stack.

In the last view controller (call it vc5), I want to add a modal segue to another view controller (mc1) since it will represent features not necessarily related to the core purpose of the app.

My question is this:

  1. How should I programmatically present mc1 (i.e. do I use performSegueWithIdentifier or presentModalViewController? etc...)

  2. How should I dismiss mc1 ? (do I use dismissViewController? Do I need to add another segue that goes from mc1 to vc5?) Obviously I still want to keep the stack present in its original order (vc1->vc2->vc3->vc4->vc5)