I tried with every answer posted for this similar question, but it is not working in Swift 3.
override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
if action == #selector(paste(_:)) {
return false
}
return super.canPerformAction(action, withSender: sender)
}
Thanks
This works!
override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
NSOperationQueue.mainQueue().addOperationWithBlock {
UIMenuController.sharedMenuController().setMenuVisible(false, animated: false)
}
return super.canPerformAction(action, withSender: sender)
}