<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewLayout/invalidationContextClass",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionViewLayout(cpy)invalidationContextClass"
  },
  "title" : "invalidationContextClass"
}
-->

# invalidationContextClass

Returns the class to use when creating an invalidation context object for the layout.

```
class var invalidationContextClass: AnyClass { get }
```

## Return Value

A custom class that descends from [`NSCollectionViewLayoutInvalidationContext`](/documentation/AppKit/NSCollectionViewLayoutInvalidationContext).

## Discussion

If you define a custom invalidation context class to store information related to your layout, override this method and use it to return your custom subclass. Methods of this class that create invalidation contexts automatically create instances of the class you provide, initializing those instances using its <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/init()> method.

---

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)