<!--
{
  "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/indexPathsToDeleteForDecorationView(ofKind:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewLayout(im)indexPathsToDeleteForDecorationViewOfKind:"
  },
  "title" : "indexPathsToDeleteForDecorationView(ofKind:)"
}
-->

# indexPathsToDeleteForDecorationView(ofKind:)

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

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

## Parameters

`elementKind`

The specific type of decoration view.

## Return Value

An array of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects indicating the decoration 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 decoration 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)