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

# collectionView(_:contextMenuConfiguration:dismissalPreviewForItemAt:)

Asks the delegate for a preview of the item at the specified index path when a context-menu interaction ends.

```
optional func collectionView(_ collectionView: UICollectionView, contextMenuConfiguration configuration: UIContextMenuConfiguration, dismissalPreviewForItemAt indexPath: IndexPath) -> UITargetedPreview?
```

## Parameters

`collectionView`

The collection view containing the item.

`configuration`

The configuration of the menu to dismiss.

`indexPath`

The index path of the item where the menu dismissal occurs.

## Return Value

A targeted preview object corresponding to the item at the index path to use during the menu’s dismissal animation.

## Discussion

The system calls this method when a context menu dismisses from the collection view. Implement this method to override the default dismissal preview that the collection view generates for the item at `indexPath`.

---

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)