<!--
{
  "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(_:shouldShowMenuForItemAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UICollectionViewDelegate(im)collectionView:shouldShowMenuForItemAtIndexPath:"
  },
  "title" : "collectionView(_:shouldShowMenuForItemAt:)"
}
-->

# collectionView(_:shouldShowMenuForItemAt:)

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

```
optional func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool
```

## Parameters

`collectionView`

The collection view object that is making the request.

`indexPath`

The index path of the affected item.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the editing menu should be shown positioned near the item and pointing to it or <doc://com.apple.documentation/documentation/Swift/false> if it should not.

## Discussion

If the user tap-holds a certain item in the collection view, this method (if implemented) is invoked first. Return <doc://com.apple.documentation/documentation/Swift/true> if you want to permit the editing menu to be displayed. Return <doc://com.apple.documentation/documentation/Swift/false> if the editing menu shouldn’t be shown—for example, you might return <doc://com.apple.documentation/documentation/Swift/false> if the corresponding item contains data that should not be copied or pasted over.

If you do not implement this method, the default return value is <doc://com.apple.documentation/documentation/Swift/false>.

---

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)