禁止 UITextField 的粘贴、复制

- ( BOOL )canPerformAction:(SEL)action withSender:(id)sender{
     NSLog(@ "%@" , NSStringFromSelector(action));
     return   YES;
}  


- ( BOOL )canPerformAction:(SEL)action withSender:(id)sender{
     if   (action == @selector(copy:) || action == @selector(paste:)) {
         return   NO;
     }
     return   YES;
}

猜你喜欢

转载自blog.csdn.net/develop_csdn/article/details/70260038