Kaynağa Gözat

avoid having 2 copy entries in chat context menu on iOS 11-12

cyberta 4 yıl önce
ebeveyn
işleme
2bf26f8426

+ 1 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -97,7 +97,7 @@ class ChatViewController: UITableViewController {
         let copyItem = ContextMenuProvider.ContextMenuItem(
         title: String.localized("global_menu_edit_copy_desktop"),
         imageName: "ic_content_copy_white_36pt",
-        action: #selector(UIResponderStandardEditActions.copy(_:)),
+        action: #selector(BaseMessageCell.messageCopy),
         onPerform: { [weak self] indexPath in
                 guard let self = self else { return }
                 let id = self.messageIds[indexPath.row]

+ 4 - 0
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -413,6 +413,10 @@ public class BaseMessageCell: UITableViewCell {
         self.performAction(#selector(BaseMessageCell.messageReply(_:)), with: sender)
     }
 
+    @objc func messageCopy(_ sender: Any?) {
+        self.performAction(#selector(BaseMessageCell.messageCopy(_:)), with: sender)
+    }
+
     func performAction(_ action: Selector, with sender: Any?) {
         if let tableView = self.superview as? UITableView, let indexPath = tableView.indexPath(for: self) {
             // Trigger action in tableView delegate (UITableViewController)