diff --git a/Mastodon/Scene/MediaPreview/Image/MediaPreviewImageViewController.swift b/Mastodon/Scene/MediaPreview/Image/MediaPreviewImageViewController.swift index 68bc0219f..a431d4dda 100644 --- a/Mastodon/Scene/MediaPreview/Image/MediaPreviewImageViewController.swift +++ b/Mastodon/Scene/MediaPreview/Image/MediaPreviewImageViewController.swift @@ -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 { diff --git a/Mastodon/Scene/MediaPreview/MediaPreviewViewController.swift b/Mastodon/Scene/MediaPreview/MediaPreviewViewController.swift index f68bd1b70..cd94a7f8d 100644 --- a/Mastodon/Scene/MediaPreview/MediaPreviewViewController.swift +++ b/Mastodon/Scene/MediaPreview/MediaPreviewViewController.swift @@ -273,10 +273,6 @@ extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate { } } - func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, longPressGestureRecognizerDidTrigger longPressGestureRecognizer: UILongPressGestureRecognizer) { - // do nothing - } - func mediaPreviewImageViewController( _ viewController: MediaPreviewImageViewController, contextMenuActionPerform action: MediaPreviewImageViewController.ContextMenuAction