Search code examples
uicollectionviewuicollectionviewcelluimenucontrolleruimenuitem

UICollectionView UIMenuController get cell


I successfully added custom UIMenuItems to the context menu of a UICollectionViewCell.

When using the builtin actions (cut / copy / paste) the -collectionView:performAction:forItemAtIndexPath:withSender delegate method gets called.

But it never gets called if invoking custom actions. Is there any easy possibility to get the corresponding UICollectionViewCell from the UIMenuItem?


Solution

  • Here is an example, take a look at this http://paulsolt.com/2012/11/uicollectionview-custom-actions-and-uimenucontroller/