Disable Look Up from UIMenuController

180 Views Asked by At

I want to disable Look Up when I double tap on my UITextField. Btw, the below code worked with Share but not for Look Up (I have also change the String of Look up to any possible notation but still not working).

    override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
    
    if  action == #selector(UIResponderStandardEditActions.paste(_:)) ||
            action == #selector(UIResponderStandardEditActions.cut(_:)) ||
            action == #selector(UIResponderStandardEditActions.copy(_:)) ||
            action.description.contains("_share") ||
            action.description.contains("_Look_Up")
            {
                return false
            }
    return super.canPerformAction(action, withSender: sender)
}
0

There are 0 best solutions below