Fix gallery expand animation description not starting at correct

position

Safe are insets weren't being taken into account when hiding the
controls, because the toVC had not yet been added to the container view
and thus didn't have anything to receive insets from.
This commit is contained in:
Shadowfacts 2020-09-12 11:34:46 -04:00
parent 95b215c6b5
commit 34a01094f7
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 2 deletions

View File

@ -48,7 +48,7 @@ class LargeImageExpandAnimationController: NSObject, UIViewControllerAnimatedTra
} }
let containerView = transitionContext.containerView let containerView = transitionContext.containerView
containerView.addSubview(toVC.view)
let finalVCFrame = transitionContext.finalFrame(for: toVC) let finalVCFrame = transitionContext.finalFrame(for: toVC)
guard let sourceView = toVC.animationSourceView, guard let sourceView = toVC.animationSourceView,
@ -85,7 +85,6 @@ class LargeImageExpandAnimationController: NSObject, UIViewControllerAnimatedTra
imageView.layer.maskedCorners = sourceView.layer.maskedCorners imageView.layer.maskedCorners = sourceView.layer.maskedCorners
imageView.layer.masksToBounds = true imageView.layer.masksToBounds = true
containerView.addSubview(toVC.view)
containerView.addSubview(imageView) containerView.addSubview(imageView)
let duration = transitionDuration(using: transitionContext) let duration = transitionDuration(using: transitionContext)