Fix gallery crossfade transition not working when gallery presented from modally-presented VC

This commit is contained in:
Shadowfacts 2025-02-05 11:33:32 -05:00
parent fabb5cd257
commit bf9ec17513

View File

@ -168,10 +168,17 @@ class GalleryDismissAnimationController: NSObject, UIViewControllerAnimatedTrans
return
}
let container = transitionContext.containerView
// See comment above.
if toVC.view.superview == nil {
toVC.view.frame = container.bounds
container.addSubview(toVC.view)
}
toVC.view.frame = transitionContext.containerView.bounds
fromVC.view.frame = transitionContext.containerView.bounds
transitionContext.containerView.addSubview(toVC.view)
transitionContext.containerView.addSubview(fromVC.view)
container.addSubview(fromVC.view)
let duration = transitionDuration(using: transitionContext)
let animator = UIViewPropertyAnimator(duration: duration, curve: .easeInOut)