Remove unused long press gesture recognizer

This commit is contained in:
Jed Fox 2023-07-04 08:49:26 -04:00
parent e50b9e13a6
commit e16185fa71
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
2 changed files with 1 additions and 16 deletions

View File

@ -15,7 +15,6 @@ import VisionKit
protocol MediaPreviewImageViewControllerDelegate: AnyObject {
func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, tapGestureRecognizerDidTrigger tapGestureRecognizer: UITapGestureRecognizer)
func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, longPressGestureRecognizerDidTrigger longPressGestureRecognizer: UILongPressGestureRecognizer)
func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, contextMenuActionPerform action: MediaPreviewImageViewController.ContextMenuAction)
}
@ -31,7 +30,6 @@ final class MediaPreviewImageViewController: UIViewController {
let previewImageView = MediaPreviewImageView()
let tapGestureRecognizer = UITapGestureRecognizer.singleTapGestureRecognizer
let longPressGestureRecognizer = UILongPressGestureRecognizer()
deinit {
os_log("%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
@ -58,13 +56,9 @@ extension MediaPreviewImageViewController {
tapGestureRecognizer.addTarget(self, action: #selector(MediaPreviewImageViewController.tapGestureRecognizerHandler(_:)))
tapGestureRecognizer.delegate = self
longPressGestureRecognizer.addTarget(self, action: #selector(MediaPreviewImageViewController.longPressGestureRecognizerHandler(_:)))
longPressGestureRecognizer.delegate = self
tapGestureRecognizer.require(toFail: previewImageView.doubleTapGestureRecognizer)
tapGestureRecognizer.require(toFail: longPressGestureRecognizer)
previewImageView.addGestureRecognizer(tapGestureRecognizer)
previewImageView.addGestureRecognizer(longPressGestureRecognizer)
let previewImageViewContextMenuInteraction = UIContextMenuInteraction(delegate: self)
previewImageView.addInteraction(previewImageViewContextMenuInteraction)
@ -95,11 +89,6 @@ extension MediaPreviewImageViewController {
delegate?.mediaPreviewImageViewController(self, tapGestureRecognizerDidTrigger: sender)
}
@objc private func longPressGestureRecognizerHandler(_ sender: UILongPressGestureRecognizer) {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
delegate?.mediaPreviewImageViewController(self, longPressGestureRecognizerDidTrigger: sender)
}
}
extension MediaPreviewImageViewController: MediaPreviewPage {

View File

@ -273,10 +273,6 @@ extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate {
}
}
func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, longPressGestureRecognizerDidTrigger longPressGestureRecognizer: UILongPressGestureRecognizer) {
// do nothing
}
func mediaPreviewImageViewController(
_ viewController: MediaPreviewImageViewController,
contextMenuActionPerform action: MediaPreviewImageViewController.ContextMenuAction