Skip to content

Instantly share code, notes, and snippets.

@laiso
Created February 22, 2011 06:05
Show Gist options
  • Save laiso/838284 to your computer and use it in GitHub Desktop.
Save laiso/838284 to your computer and use it in GitHub Desktop.
UIWebView でコピー&ペースト(カットも)のメニュー呼び出しを無効化して禁止にするやつ
#pragma mark -
#pragma mark Managing the Selection and the Edit Menu
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
UIMenuController *menuController = [UIMenuController sharedMenuController];
[menuController setMenuVisible:NO animated:NO];
if (action == @selector(cut:) ||
action == @selector(copy:) ||
action == @selector(paste:)) {
return NO;
} else {
return [super canPerformAction:action withSender:sender];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment