I\'m using the new customization abilities of the UIMenuController to add things other than \"Copy\" to the menu for cut&paste into a webview.
What I do is getting t
fluXa's answer is actually correct, but I dont think it was very clear.
The issue is that when adding custom UIMenuItem objects to the shared menu controller ([UIMenuController sharedMenuController]), only the first custom UIMenuItem will be shown on the initial display of the menu. The remaining custom menu items will be shown if the user taps "More...".
However, if the menu doesn't include any built-in system menu items (copy:, paste:, etc), the initial menu display will show all custom menu items and no "More..." item.
If you need to include the built-in system items, simply add custom UIMenuItems having the same title but with a different selector. ( myCopy: vs. copy: )
Essentially it boils down to NOT calling the default implementation of canPerformAction:withSender:, explicitly handling all custom menu items, and returning NO for all other (system-supplied) menu items:
- (BOOL) canPerformAction:(SEL)action withSender:(id)sender
{
if ( action == @selector( onCommand1: ) )
{
// logic for showing/hiding command1
BOOL show = ...;
return show;
}
if ( action == @selector( onCommand2: ) )
{
// logic for showing/hiding command2
BOOL show = ...;
return show;
}
if ( action == @selector( onCopy: ) )
{
// always show our custom "copy" command
return YES;
}
return NO;
}