I have written a custom UIStoryboardSegue.
The only code in my CustomSegue.m file is:
-(void) perform {
UIViewController* sourceViewController = (UIViewController *) self.sourceViewController;
UIViewController* destinationViewController = (UIViewController *) self.destinationViewController;
UIWindow* window = UIApplication.sharedApplication.keyWindow;
window.rootViewController = destinationViewController;
window.rootViewController = sourceViewController;
[UIView transitionWithView: sourceViewController.view.window
duration: 0.5
options: UIViewAnimationOptionTransitionFlipFromLeft
animations: ^{window.rootViewController = destinationViewController;}
completion: ^(BOOL finished) {}
];
}
If I set up a storyboard so it just has two UIViewControllers, with a button on the first linking to the second, all works as planned: there is a flip from left transition.
But: if I place a UINavigationController before the first UIViewController, the segue now brings up the second view controller without doing a flip from left.
What is going on? Why doesn't the transition work with a navigation controller?
Thanks for your help!
(In case you're interested, the reason I'm using a custom segue is so that I can have a master-detail view appearing after some intro pages. I am inspired by this Stackoverflow answer.)