Skip to content

Commit

Permalink
Fixes #544 first suggestion: down swipes return to album
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyLB committed Jul 15, 2023
1 parent 47f0dc5 commit 05f3428
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions piwigo/Image/ImageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 05f3428

Please sign in to comment.