2
votes

In my application I am showing a UIMenuController with menus share, delete, etc for a UITableViewCell long press gesture.

It works perfectly, but after showing the menu, the default UIMenuController of UITextfield also has copy, paste, select menu items.

How do I remove these 'standard' menu items?

2

2 Answers

1
votes

You should implement the method

- (BOOL)canPerformAction:(SEL)action
              withSender:(id)sender

and return YES for actions you want and NO for actions you don't want.

0
votes

Override the method of UITextfield as below

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
return NO;
}