Instance Method

collectionView:performAction:forItemAtIndexPath:withSender:

Tells the delegate to perform the specified action on an item in the collection view.

Declaration

- (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;

Parameters

collectionView

The collection view object that is making the request.

action

The selector representing the action to be performed.

indexPath

The index path of the affected item.

sender

The object that initiated the action.

Discussion

If the user taps an action in the editing menu, the collection view calls this method. Your implementation of this method should do whatever is appropriate for the action. For example, for a copy action, it should extract the relevant item content and write it to the general pasteboard or an application (private) pasteboard.

For information about how to perform pasteboard-related operations, see UIPasteboard.

See Also

Managing Actions for Cells

- collectionView:shouldShowMenuForItemAtIndexPath:

Asks the delegate if an action menu should be displayed for the specified item.

Deprecated
- collectionView:canPerformAction:forItemAtIndexPath:withSender:

Asks the delegate if it can perform the specified action on an item in the collection view.

Deprecated