|
@@ -465,7 +465,7 @@ extension MediaCategoryViewController {
|
|
for: .touchUpInside)
|
|
for: .touchUpInside)
|
|
sortButton
|
|
sortButton
|
|
.addGestureRecognizer(UILongPressGestureRecognizer(target: self,
|
|
.addGestureRecognizer(UILongPressGestureRecognizer(target: self,
|
|
- action: #selector(handleSortShortcut)))
|
|
|
|
|
|
+ action: #selector(handleSortLongPress(sender:))))
|
|
|
|
|
|
sortButton.tintColor = PresentationTheme.current.colors.orangeUI
|
|
sortButton.tintColor = PresentationTheme.current.colors.orangeUI
|
|
sortButton.accessibilityLabel = NSLocalizedString("BUTTON_SORT", comment: "")
|
|
sortButton.accessibilityLabel = NSLocalizedString("BUTTON_SORT", comment: "")
|
|
@@ -501,6 +501,15 @@ extension MediaCategoryViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @objc func handleSortLongPress(sender: UILongPressGestureRecognizer) {
|
|
|
|
+ if sender.state == .began {
|
|
|
|
+ if #available(iOS 10.0, *) {
|
|
|
|
+ UIImpactFeedbackGenerator(style: .medium).impactOccurred()
|
|
|
|
+ }
|
|
|
|
+ handleSortShortcut()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@objc func handleSortShortcut() {
|
|
@objc func handleSortShortcut() {
|
|
model.sort(by: model.sortModel.currentSort, desc: !model.sortModel.desc)
|
|
model.sort(by: model.sortModel.currentSort, desc: !model.sortModel.desc)
|
|
}
|
|
}
|