CardPresentationController icon indicating copy to clipboard operation
CardPresentationController copied to clipboard

Support Dismiss without Animation

Open jrendel opened this issue 6 years ago • 3 comments

If I call dismiss(animated: false) the animation does not complete properly and the underlying view is left in the state it is in when behind the modal.

Is this meant to work?

jrendel avatar Nov 15 '19 17:11 jrendel

Not sure, will need to check this out.

radianttap avatar Nov 15 '19 20:11 radianttap

If the animated: false is sent, both on presenting and dismissing, these respective methods are not called:

func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning?

func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning?

I'm not sure what is UIKit internally doing in this case or what's the appropriate way to render the final display.

radianttap avatar Nov 21 '19 09:11 radianttap

In order to perform required visual changes, I need access to UIViewControllerContextTransitioning which is not available anywhere I can see except inside the animateTransition(using transitionContext: UIViewControllerContextTransitioning) which is not called because previously mentioned animationController(...) APIs are not called.

Any way to build that context manually..?

radianttap avatar Nov 21 '19 11:11 radianttap