Created
June 29, 2015 08:57
-
-
Save victorchee/b15d3d40a98168d429b4 to your computer and use it in GitHub Desktop.
判断是否允许'paste', 'select', 'selectAll'编辑
This file contains hidden or 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
| -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { | |
| [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | |
| [[UIMenuController sharedMenuController] setMenuVisible:NO animated:NO]; | |
| }]; | |
| if (action == @selector(paste:)) | |
| return NO; | |
| if (action == @selector(select:)) | |
| return NO; | |
| if (action == @selector(selectAll:)) | |
| 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