forked from shadowfacts/Tusker
Fix double gestures in attachments gallery
This commit is contained in:
parent
ae416bb604
commit
4018d39312
|
@ -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)
|
||||
|
|
|
@ -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,8 +93,10 @@ class LoadingLargeImageViewController: UIViewController, LargeImageAnimatableVie
|
|||
}
|
||||
}
|
||||
|
||||
if shrinkGestureEnabled {
|
||||
dismissInteractionController = LargeImageInteractionController(viewController: self)
|
||||
}
|
||||
}
|
||||
|
||||
override func didMove(toParent parent: UIViewController?) {
|
||||
super.didMove(toParent: parent)
|
||||
|
|
Loading…
Reference in New Issue