Allow scrolling w/ trackpad/magic mouse to dismiss gallery
This commit is contained in:
parent
49a437583e
commit
e612964464
|
@ -19,7 +19,11 @@ class LargeImageInteractionController: UIPercentDrivenInteractiveTransition {
|
||||||
init(viewController: UIViewController) {
|
init(viewController: UIViewController) {
|
||||||
super.init()
|
super.init()
|
||||||
self.viewController = viewController
|
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) {
|
@objc func handleGesture(_ recognizer: UIPanGestureRecognizer) {
|
||||||
|
|
Loading…
Reference in New Issue