I've been following some tutorials to create custom animation while transitioning from one view to another.
My test project using custom segue from here works fine, but someone told me it's not encouraged anymore to do custom animation within a custom segue, and I should use UIViewControllerAnimatedTransitioning
.
I followed several tutorials that make use of this protocol, but all of them are about modal presentation (for example this tutorial).
What I'm trying to do is a push segue inside a navigation controller tree, but when I try to do the same thing with a show (push) segue it doesn't work anymore.
Please tell me the correct way to do custom transitioning animation from one view to another in a navigation controller.
And is there anyway I can use one method for all transitioning animations? It would be awkward if one day I want to do the same animation but end up having to duplicate the code twice to work on modal vs controller transitioning.
self.navigationController.delegate = self;
inviewDidLoad
. You might get a warning unless you also specify in the@interface
line that your view controller conforms to<UINavigationControllerDelegate>
protocol. – Wineskin