Allow scrolling w/ trackpad/magic mouse to dismiss gallery

This commit is contained in:
Shadowfacts 2020-03-25 22:11:08 -04:00
parent 49a437583e
commit e612964464
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,11 @@ class LargeImageInteractionController: UIPercentDrivenInteractiveTransition {
init(viewController: UIViewController) {
super.init()
self.viewController = viewController
viewController.view.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(handleGesture(_:))))
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(handleGesture(_:)))
if #available(iOS 13.4, *) {
panRecognizer.allowedScrollTypesMask = .all
}
viewController.view.addGestureRecognizer(panRecognizer)
}
@objc func handleGesture(_ recognizer: UIPanGestureRecognizer) {