From 88176fe59956efccf3055d023bcbc991d27fe3d2 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 26 Nov 2024 20:05:55 -0500 Subject: [PATCH] Try to fix Live Text control weridness during interactive gallery dismissal --- .../GalleryVC/GalleryDismissAnimationController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissAnimationController.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissAnimationController.swift index c14ef041..7eeb0cc6 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissAnimationController.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissAnimationController.swift @@ -95,6 +95,12 @@ class GalleryDismissAnimationController: NSObject, UIViewControllerAnimatedTrans container.layoutIfNeeded() + // Hide overlaid controls immediately, to prevent the Live Text button's position + // getting caught up in the rest of the animation. + UIView.animate(withDuration: 0.1) { + content.setControlsVisible(false, animated: false, dueToUserInteraction: false) + } + let duration = self.transitionDuration(using: transitionContext) var initialVelocity: CGVector if let interactiveVelocity,