<!--
{
  "availability" : [
    "iOS: 6.0.0 - 13.0.0",
    "iPadOS: 6.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "tvOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewDelegate/collectionView(_:performAction:forItemAt:withSender:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UICollectionViewDelegate(im)collectionView:performAction:forItemAtIndexPath:withSender:"
  },
  "title" : "collectionView(_:performAction:forItemAt:withSender:)"
}
-->

# collectionView(_:performAction:forItemAt:withSender:)

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

```
optional func collectionView(_ collectionView: UICollectionView, performAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?)
```

## 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`](/documentation/UIKit/UIPasteboard).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)