So, I am not sure if I am doing something wrong here, but I have a UIViewController that has a UICollectionView on it. In the UIViewController's viewDidLoad
method, I do the following it doesn't add any custom menu items to the popup that shows up.
UIMenuItem *removeItem = [[UIMenuItem alloc] initWithTitle:@"Remove" action:@selector(handleRemoveItem:)];
UIMenuItem *duplicateItem = [[UIMenuItem alloc] initWithTitle:@"Duplicate" action:@selector(handleDuplicateItem:)];
[[UIMenuController sharedMenuController] setMenuItems:@[removeItem, duplicateItem]];
[removeItem release];
[duplicateItem release];
I did set the collectionView:shouldShowMenuForItemAtIndexPath:
and the collectionView:canPerformAction:forItemAtIndexPath:withSender:
to return YES
under all circumstances, but no matter what, only Cut, Copy, and Paste will show up.
Did I not implement this fully, or did I not do it right?
P.S. - I did look at as many examples as I could throughout google and I didn't find anything that helped.