<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:didEndDisplaying:forRepresentedObjectAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCollectionViewDelegate(im)collectionView:didEndDisplayingItem:forRepresentedObjectAtIndexPath:"
  },
  "title" : "collectionView(_:didEndDisplaying:forRepresentedObjectAt:)"
}
-->

# collectionView(_:didEndDisplaying:forRepresentedObjectAt:)

Notifies the delegate that the specified item was removed from the collection view.

```
@MainActor optional func collectionView(_ collectionView: NSCollectionView, didEndDisplaying item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath)
```

## Parameters

`collectionView`

The collection view that removed the item.

`item`

The item that was removed.

`indexPath`

The index path of the item.

## Discussion

The collection view calls this method after removing an item from its content. You can use this method to track the removal of items and perform related tasks.

---

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)