Check this accepted answer to this question.
You can subclass UITextField and override the below method to disable whichever action you want :
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
if (action == @selector(paste:))
{
return NO;
}
else if (action == @selector(cut:))
{
return NO;
}
else if (action == @selector(copy:))
{
return NO;
}
... //etc etc
return [super canPerformAction:action withSender:sender];
}
and display your own using the following code:
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setTargetRect:textField.frame inView:textField.superview];
[menu setMenuItems:[NSArray arrayWithObjects:
[[UIMenuItem alloc] initWithTitle:@"Test" action:@selector(test)],
nil]];
[menu setMenuVisible:YES animated:YES];
and in the canPeformAction:withSender:
method you can return YES
for the selector Test
.