Tom Odell Tom Odell - 3 months ago 15
Swift Question

How to disable the default UIMenuItem without affecting messages UIMenuItem?

There is a way to disable the default UIMenuItem

enter image description here

Without affecting messages UIMenuItem?
enter image description here

ViewDidLoad:

JSQMessagesCollectionViewCell.registerMenuAction(#selector(UIResponderStandardEditActions.delete(_:)))
UIMenuController.shared.menuItems = [UIMenuItem.init(title: "Delete", action: Selector(("delete")))]

Answer

Use

cell.textView.selectable = false in cellForRow method