<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewLayout/indexPathsToDeleteForSupplementaryView(ofKind:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewLayout(im)indexPathsToDeleteForSupplementaryViewOfKind:"
  },
  "title" : "indexPathsToDeleteForSupplementaryView(ofKind:)"
}
-->

# indexPathsToDeleteForSupplementaryView(ofKind:)

Retrieves an array of index paths representing the supplementary views to remove.

```
func indexPathsToDeleteForSupplementaryView(ofKind elementKind: String) -> [IndexPath]
```

## Parameters

`elementKind`

The specific type of supplementary view.

## Return Value

An array of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects indicating the supplementary views you want to remove or an empty array if you do not want to remove any views of the given kind.

## Discussion

The collection view calls this method whenever you delete cells or sections to the collection view. Implementing this method gives your layout object an opportunity to remove any supplementary views that are no longer needed.

The collection view calls this method between its calls to [`prepare(forCollectionViewUpdates:)`](/documentation/UIKit/UICollectionViewLayout/prepare(forCollectionViewUpdates:)) and [`finalizeCollectionViewUpdates()`](/documentation/UIKit/UICollectionViewLayout/finalizeCollectionViewUpdates()).

---

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)