I need to show UIMenuController with 2 actions in my keyboard extension. It must appear when user click on button on collection view's cell (cell.textButton in code)
When I'm trying to show it all my keyboard view controller becomes grey, without crash:
Here is a code:
UIMenuItem *actionCopy = [[UIMenuItem alloc] initWithTitle:@"someaction1" action:@selector(action1)];
UIMenuItem *actionDefine = [[UIMenuItem alloc] initWithTitle:@"someaction2" action:@selector(action2:)];
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setMenuItems:[NSArray arrayWithObjects:actionCopy, actionDefine, nil]];
CGRect frame = [self.view convertRect:cell.textButton.frame fromView:cell.textButton];
[menu update];
[self becomeFirstResponder];
[menu setTargetRect:frame inView:self.view];
[menu setMenuVisible:YES animated:YES];
Did someone try to add UIMenuController to keyboard extension? thanks