Как отключить копирование и определение UIMenuItems UIMenuController в UITextfield

Я реализую кастомUIMenuController и пытается выяснить. Как можно юридически отключить «Копировать» и «Определить» UIMenuItemsUIMenuController вUITextfield? Текстовое поле не редактируется. Я попытался отключить «Копировать» с помощью:

-(BOOL)canPerformAction:(SEL)action withSender:(id)sender 
{
   if (action == @selector(copy:))
    {
        return NO;
    }

    return [super canPerformAction:action withSender:sender];
}


- (IBAction)tapTextViewGesture:(id)sender {

  UIMenuItem *myItem1 = [[UIMenuItem alloc] initWithTitle:@"myItem1" action:@selector(myItem1Pressed:)];
  UIMenuItem *myItem2 = [[UIMenuItem alloc] initWithTitle:@"myItem2" action:@selector(myItem2Pressed:)];
  UIMenuItem *myItem3 = [[UIMenuItem alloc] initWithTitle:@"myItem3" action:@selector(myItem3Pressed:)];

    // Access the application's shared menu
    UIMenuController *menu = [UIMenuController sharedMenuController];

    [menu setMenuItems:[NSArray arrayWithObjects:myItem1,myItem2,myItem3, nil]];

    CGRect menuRect = CGRectMake(20, 50, 200, 0);


    // Show the menu from the cursor's position
    [menu setTargetRect:menuRect inView:self.view];


    [menu setMenuVisible:YES animated:YES];
}

Но в меню все еще отображаются «Копировать» и «Определить»UIMenuItems, Как я могу их отключить, оставив только мои вещи?

Ответы на вопрос(5)

Ваш ответ на вопрос