Last active
August 29, 2015 14:25
-
-
Save stdrc/017c6c2a714483a07f75 to your computer and use it in GitHub Desktop.
UITextField 或 UITextView 中禁用部分指定操作(如复制、剪切)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a subclass of `UITextField` or `UITextView`, | |
// and override the `canPerformAction:withSender:` method like following: | |
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender | |
{ | |
if (action == @selector(copy:)) | |
return NO; | |
return [super canPerformAction:action withSender:sender]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment