---
title: "collectionView(_:didEndDisplaying:forRepresentedObjectAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionviewdelegate/collectionview(_:didenddisplaying:forrepresentedobjectat:)"
---

# collectionView(_:didEndDisplaying:forRepresentedObjectAt:)

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

## Declaration

```swift
@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

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.

## See Also

### Tracking the Addition and Removal of Items

- [collectionView(_:willDisplay:forRepresentedObjectAt:)](appkit/nscollectionviewdelegate/collectionview(_:willdisplay:forrepresentedobjectat:).md)
- [collectionView(_:willDisplaySupplementaryView:forElementKind:at:)](appkit/nscollectionviewdelegate/collectionview(_:willdisplaysupplementaryview:forelementkind:at:).md)
- [collectionView(_:didEndDisplayingSupplementaryView:forElementOfKind:at:)](appkit/nscollectionviewdelegate/collectionview(_:didenddisplayingsupplementaryview:forelementofkind:at:).md)
