<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewLayoutInvalidationContext/invalidateDecorationElements(ofKind:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionViewLayoutInvalidationContext(im)invalidateDecorationElementsOfKind:atIndexPaths:"
  },
  "title" : "invalidateDecorationElements(ofKind:at:)"
}
-->

# invalidateDecorationElements(ofKind:at:)

Marks the specified decoration views as invalid so that their layout information can be updated.

```
func invalidateDecorationElements(ofKind elementKind: NSCollectionView.DecorationElementKind, at indexPaths: Set<IndexPath>)
```

## Parameters

`elementKind`

A string that identifies the type of the decoration views. This parameter must not be `nil` or an empty string.

`indexPaths`

A set of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects. Each index path contains the section in which the decoration view appears.

## Discussion

Call this method when you want the layout object to recompute attributes for one or more decoration views. All of the views must be of the type specified by the `elementKind` parameter. The method adds the views you specify to the [`invalidatedDecorationIndexPaths`](/documentation/AppKit/NSCollectionViewLayoutInvalidationContext/invalidatedDecorationIndexPaths) property. You can call this method more than once for the specified `elementKind` value.

---

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)