---
title: "collectionView(_:didEndDisplayingSupplementaryView:forElementOfKind:at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionviewdelegate/collectionview(_:didenddisplayingsupplementaryview:forelementofkind:at:)"
---

# collectionView(_:didEndDisplayingSupplementaryView:forElementOfKind:at:)

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

## Declaration

```swift
@MainActor optional func collectionView(_ collectionView: NSCollectionView, didEndDisplayingSupplementaryView view: NSView, forElementOfKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath)
```

## Parameters

- `collectionView`: The collection view that removed the view.
- `view`: The supplementary view that was removed.
- `elementKind`: The type of the supplementary view. Layouts are responsible for defining the types of supplementary views they support.
- `indexPath`: The index path associated with the supplementary view.

## Discussion

Discussion The collection view calls this method after removing a supplementary view from its content. You can use this method to track the removal of views and perform related tasks.

## See Also

### Tracking the Addition and Removal of Items

- [collectionView(_:willDisplay:forRepresentedObjectAt:)](appkit/nscollectionviewdelegate/collectionview(_:willdisplay:forrepresentedobjectat:).md)
- [collectionView(_:didEndDisplaying:forRepresentedObjectAt:)](appkit/nscollectionviewdelegate/collectionview(_:didenddisplaying:forrepresentedobjectat:).md)
- [collectionView(_:willDisplaySupplementaryView:forElementKind:at:)](appkit/nscollectionviewdelegate/collectionview(_:willdisplaysupplementaryview:forelementkind:at:).md)
