From 4018d39312199b206ef1ed6e61f888e9d2d22753 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 17 Mar 2020 21:56:29 -0400 Subject: [PATCH] Fix double gestures in attachments gallery --- .../Screens/Attachment Gallery/GalleryViewController.swift | 4 +++- .../Large Image/LoadingLargeImageViewController.swift | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Attachment Gallery/GalleryViewController.swift b/Tusker/Screens/Attachment Gallery/GalleryViewController.swift index ff203f03..320a3b9a 100644 --- a/Tusker/Screens/Attachment Gallery/GalleryViewController.swift +++ b/Tusker/Screens/Attachment Gallery/GalleryViewController.swift @@ -67,7 +67,9 @@ class GalleryViewController: UIPageViewController, UIPageViewControllerDataSourc self.pages = attachments.map { switch $0.kind { case .image: - return LoadingLargeImageViewController(attachment: $0) + let vc = LoadingLargeImageViewController(attachment: $0) + vc.shrinkGestureEnabled = false + return vc case .video, .audio: let vc = AVPlayerViewController() vc.player = AVPlayer(url: $0.url) diff --git a/Tusker/Screens/Large Image/LoadingLargeImageViewController.swift b/Tusker/Screens/Large Image/LoadingLargeImageViewController.swift index dee16a24..d10c7ffd 100644 --- a/Tusker/Screens/Large Image/LoadingLargeImageViewController.swift +++ b/Tusker/Screens/Large Image/LoadingLargeImageViewController.swift @@ -33,6 +33,8 @@ class LoadingLargeImageViewController: UIViewController, LargeImageAnimatableVie } } + var shrinkGestureEnabled = true + var animationSourceInfo: LargeImageViewController.SourceInfo? var animationImage: UIImage? { animationSourceInfo?.image ?? largeImageVC?.image } var animationGifData: Data? { largeImageVC?.gifData } @@ -91,7 +93,9 @@ class LoadingLargeImageViewController: UIViewController, LargeImageAnimatableVie } } - dismissInteractionController = LargeImageInteractionController(viewController: self) + if shrinkGestureEnabled { + dismissInteractionController = LargeImageInteractionController(viewController: self) + } } override func didMove(toParent parent: UIViewController?) {