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 {
|
self.pages = attachments.map {
|
||||||
switch $0.kind {
|
switch $0.kind {
|
||||||
case .image:
|
case .image:
|
||||||
return LoadingLargeImageViewController(attachment: $0)
|
let vc = LoadingLargeImageViewController(attachment: $0)
|
||||||
|
vc.shrinkGestureEnabled = false
|
||||||
|
return vc
|
||||||
case .video, .audio:
|
case .video, .audio:
|
||||||
let vc = AVPlayerViewController()
|
let vc = AVPlayerViewController()
|
||||||
vc.player = AVPlayer(url: $0.url)
|
vc.player = AVPlayer(url: $0.url)
|
||||||
|
|
|
@ -33,6 +33,8 @@ class LoadingLargeImageViewController: UIViewController, LargeImageAnimatableVie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var shrinkGestureEnabled = true
|
||||||
|
|
||||||
var animationSourceInfo: LargeImageViewController.SourceInfo?
|
var animationSourceInfo: LargeImageViewController.SourceInfo?
|
||||||
var animationImage: UIImage? { animationSourceInfo?.image ?? largeImageVC?.image }
|
var animationImage: UIImage? { animationSourceInfo?.image ?? largeImageVC?.image }
|
||||||
var animationGifData: Data? { largeImageVC?.gifData }
|
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?) {
|
override func didMove(toParent parent: UIViewController?) {
|
||||||
|
|
Loading…
Reference in New Issue