<!--
{
  "availability" : [
    "iOS: 13.0.0 - 16.0.0",
    "iPadOS: 13.0.0 - 16.0.0",
    "macCatalyst: 13.1.0 - 16.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewDelegate/collectionView(_:contextMenuConfigurationForItemAt:point:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UICollectionViewDelegate(im)collectionView:contextMenuConfigurationForItemAtIndexPath:point:"
  },
  "title" : "collectionView(_:contextMenuConfigurationForItemAt:point:)"
}
-->

# collectionView(_:contextMenuConfigurationForItemAt:point:)

Returns a context menu configuration for the item at a point.

```
optional func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?
```

## Parameters

`collectionView`

The collection view containing the item.

`indexPath`

The index path of the item for which a configuration is being requested.

`point`

The location of the interaction in the collection view’s coordinate space.

## Return Value

A contextual menu configuration object describing the menu to be presented. Returning `nil` prevents the interaction from beginning. Returning an empty configuration object causes the interaction to begin, and then end with a cancellation effect.

## Discussion

You can use the cancellation effect from returning an empty configuration to indicate to users that it’s possible for a menu to be presented from this item, but that there are no actions to present at this particular time.

---

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)