Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


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)