From dfb72edbd8dd74238472380fef50188ca323f224 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 14 Sep 2019 16:48:43 -0400 Subject: [PATCH] Fix opening context menu previews Closes #43 --- .../Screens/Utilities/EnhancedTableViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tusker/Screens/Utilities/EnhancedTableViewController.swift b/Tusker/Screens/Utilities/EnhancedTableViewController.swift index 9edda988..7737acf2 100644 --- a/Tusker/Screens/Utilities/EnhancedTableViewController.swift +++ b/Tusker/Screens/Utilities/EnhancedTableViewController.swift @@ -55,11 +55,11 @@ extension EnhancedTableViewController { } } - override func tableView(_ tableView: UITableView, willCommitMenuWithAnimator animator: UIContextMenuInteractionCommitAnimating) { - if /*animator.preferredCommitStyle == .pop,*/ // preferredCommitStyle is always .dismiss, see FB6113554 - let viewController = animator.previewViewController { + override func tableView(_ tableView: UITableView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) { + if let viewController = animator.previewViewController { + animator.preferredCommitStyle = .pop animator.addCompletion { - if viewController is LargeImageViewController || viewController is SFSafariViewController { + if viewController is LargeImageViewController || viewController is GalleryViewController || viewController is SFSafariViewController { self.present(viewController, animated: true) } else { self.show(viewController, sender: nil)