diff --git a/piwigo/Image/ImageViewController.swift b/piwigo/Image/ImageViewController.swift index 21911a4e9..5fb48a2e2 100644 --- a/piwigo/Image/ImageViewController.swift +++ b/piwigo/Image/ImageViewController.swift @@ -104,6 +104,12 @@ class ImageViewController: UIViewController { view.addGestureRecognizer(tapOnce) view.addGestureRecognizer(tapTwice) + // Down swipes return to album view + let swipeDown = UISwipeGestureRecognizer(target: self, action: #selector(swipeDown(_:))) + swipeDown.numberOfTouchesRequired = 1 + swipeDown.direction = .down + view.addGestureRecognizer(swipeDown) + // Register palette changes NotificationCenter.default.addObserver(self, selector: #selector(applyColorPalette), name: .pwgPaletteChanged, object: nil) @@ -566,6 +572,11 @@ class ImageViewController: UIViewController { } } + @objc func swipeDown(_ gestureRecognizer: UIGestureRecognizer) { + // Return to the album view + navigationController?.popViewController(animated: true) + } + // Display/hide status bar override var prefersStatusBarHidden: Bool { return navigationController?.isNavigationBarHidden ?? false