简体   繁体   中英

Segue/Transition between two views in a storyboard w/o a NavigationController

Is it possible to not use a NavigationController and change views with an animation/segue with a storbyboard. I cant seem to figure out how to accomplish this. I thought it would have been pretty simple but no luck. I just have two views and want to transition without adding a navigationcontroller.

Sure, just create the segue and select "modal" in the menu that pops up instead of "push".

When you want to return you do it programmatically with:

    [self dismissModalViewControllerAnimated:YES];

TJ is right about selecting a modal segue, but -dismissModalViewControllerAnimated: is deprecated in iOS 5+.

You should use -dismissViewControllerAnimated:completion: instead.

With the advent of iOS 6, you may also be able to use 'unwind actions' for dismissing presented controllers with unwind segues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM