Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to perform segue with no transition animation

I have an application which starts with a navigation controller. This navigation controller can open modal view controller:

- (void)openModalController:(id)sender {     [self performSegueWithIdentifier:@"SegueIdentifier"]; } 

But when the user opens an application using url scheme, I'd like to present the application with the modal controller opened. So I added some methods and tried:

// Controller  - (void)viewDidAppear:(BOOL)animated {     [super viewDidAppear:animated]; // animated == NO in initial loading       if (_shouldOpenModalController) {         [self openModalController:nil];     } }  - (void)setShouldOpenModalController:(BOOL)flag {     _shouldOpenModalController = flag; }  // AppDelegate  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {     if (launchOptions) {         UINavigationController *nc = (UINavigationController *)self.window.rootViewController;         MyViewController *c = (MyViewController *)[ns topViewController];         [c setShouldOpenModalController];     } } 

But here is a problem: the openModalController: performs segue with transition animation I setup in storyboard. How can it be done with no animation? Is there another approach for this task?

like image 668
voromax Avatar asked Apr 24 '13 13:04

voromax


1 Answers

Duplicate your segue in Storyboard and give the second one a different ID.

You can then change the transition in the new version.

like image 58
Gordon Dove Avatar answered Sep 17 '22 01:09

Gordon Dove