The problem is that I don't know how to dismiss and present a view controller with only one transition animation.
My storyboard structure is:
We can say that A controller is what follows the NavigationController, B is the Startup reference and C is the TabBar ViewController. Both B and C are presented modally with a Cross Dissolve transition.
When a user logins into the app (from B), C controller is presented modally with a Flip horizontal transition. And when a user logouts (from C), B is presented in the same way. On A controller I perform a direct segue to B or C depending on if user is logged or not.
My problem is that if I don't dismiss previous view controller from B or C, that controller is leaked. On the contrary if I dismiss it, A is showed before the target controller (B or C) is presented.
Is it possible to show only the Flip Horizontal transition and step over A view?
My solution to this issue was replacing current rootViewController, supporting different transitions:
Here's a solution I've used for this problem. I've no idea how it integrates with Storyboards since I don't use those.
Added this method in a category to UIViewController, then can invoke anywhere previously called
presentViewController:animated:completion
. Results in a seamless animation of the new controller while still dismissing the previous one.The both answers were very helpful, here is the Swift 4 version:
}