---
title: "collectionView(_:didEndDisplaying:forItemAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewdelegate/collectionview(_:didenddisplaying:foritemat:)"
---

# collectionView(_:didEndDisplaying:forItemAt:)

Tells the delegate that the specified cell was removed from the collection view.

## Declaration

```swift
optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath)
```

## Parameters

- `collectionView`: The collection view object that removed the cell.
- `cell`: The cell object that was removed.
- `indexPath`: The index path of the data item that the cell represented.

## Discussion

Discussion Use this method to detect when a cell is removed from a collection view, as opposed to monitoring the view itself to see when it disappears.

## See Also

### Tracking the addition and removal of views

- [collectionView(_:willDisplay:forItemAt:)](uikit/uicollectionviewdelegate/collectionview(_:willdisplay:foritemat:).md)
- [collectionView(_:willDisplaySupplementaryView:forElementKind:at:)](uikit/uicollectionviewdelegate/collectionview(_:willdisplaysupplementaryview:forelementkind:at:).md)
- [collectionView(_:didEndDisplayingSupplementaryView:forElementOfKind:at:)](uikit/uicollectionviewdelegate/collectionview(_:didenddisplayingsupplementaryview:forelementofkind:at:).md)
