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

View File

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