0
votes

I have a subclassed UITextView that I would like to show a custom UIMenuItem when a user pressed and holds in the UITextView. For the life of me, I cannot get my custom item to show. Here is what I am doing in viewDidLoad:

UIMenuItem *customMenuItem1 = [[UIMenuItem alloc] initWithTitle:@"Keywords" action:@selector(insertKeywords)];
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObject:customMenuItem1]];

Pressing and holding in my subclases UITextView I still only see "Select" and "Select All".

What do I need to do to also show my custom item?

1

1 Answers

0
votes

Figured it out. I had never implemented the insertKeywords method, so the UIMenuItem was never shown!