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?
Duplicate your segue in Storyboard and give the second one a different ID.
You can then change the transition in the new version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With