Can you mix UIModalPresentationCurrentContext and custom transition?

I have a UI application that contains two elements, each of which is its own view controller. When you decide to change one of the elements, I use presentViewController:animated:completion:

c UIModalPresentationCurrentContext

to modally present the collector for just the element you are changing. Since the view controller is set up to define the context of the view, this ensures not only that the collector only covers that view controller, but also that it presentingViewController

's the one for that element, so an unwinding session initiated by selecting an element goes through which also looks at the controller, changing the element.

This works great, except I want to do it with a custom (and hopefully interactive) transition. For this, I tried to install the collector transitioningDelegate

on a custom object that implements UIViewControllerTransitioningDelegate

. However, it is transitioningDelegate

ignored unless you are using UIModalPresentationCustom

that ignores definesPresentationContext

and submits from the root view controller, thus breaking all this.

Is there a way to present a modal view controller with a custom transition that takes view contexts into account? Or will I have to find another way to do this?

+3


source to share





All Articles