I use custom UIPresentationController to perform sequel with my own animation. In prepareForSegue:
myDestinationController.transitioningDelegate = DBViewControllerTransitioningDelegate()
myDestinationController.modalPresentationStyle = .Custom
This is mine DBViewControllerTransitioningDelegate
:
class DBViewControllerTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate {
func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? {
return DBOverlayPresentationController(presentedViewController: presented, presentingViewController: presenting)
}
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return DBTransitioningAnimator()
}
}
It is not working, because the methods are not called. But when I set:
myDestinationController.transitioningDelegate = self
and within my self
controller add 2 methods from my DBViewControllerTransitioningDelegate
everything is fine. These two methods are called. Why? What is the difference?