Search code examples
iosobjective-cuilabeltttattritubedlabel

Disable Copy on UILabel with UserInteractionEnabled enabled


I use TTTAttributedLabel for customizing my UILabel. But there is a problem, i do not want to have the function "copy to clipboard" when i hold my finger on the label and, in the official documentation, seems that there is no way to disable this function.

Anyone know how to do this?

PS: sorry for my first post, it was night in Italy and i was very very tired. Sorry for my bad english.

enter image description here


Solution

  • The GitHub fork you linked is not the original project by Mattt.

    If you'd like to continue using the fork, you can subclass it and override canPerformAction:withSender: to return NO:

    - (BOOL) canPerformAction:(SEL) action withSender:(id)sender {
        return NO;
    }