I would like to implement a custom interactive UIViewController transition that works as follows:
- There is a parent UIViewController that presents a full-screen child UIViewController.
- If I swipe left, the child view controller gets displaced to the left and a new child view controller appears on the right.
- If the transition finishes, the new child view controller occupies the screen and the old child view controller is removed.
The interaction has to be interactive, so that the transition animation happens alongside the swipe gesture.
I have thought of two ways to implement this:
1) Use a UINavigationController and implement the UINavigationControllerDelegate protocol, setting up the animation and interaction controllers there.
However, this is not a good solution because I don't want stack-based navigation, and don't want to keep a reference to the old child view controller.
2) Implement the UIViewControllerTransitioningDelegate protocol and use the "presentViewController:animated:completion:" method.
However, this method should be used to present a view controller modally, not to replace a currently shown view controller with a new one.
Is there a different way to do this?