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

# NSCollectionViewFlowLayoutInvalidationContext

An object that identifies the portions of a flow layout object that need to be updated.

```
class NSCollectionViewFlowLayoutInvalidationContext
```

## Overview

Layout objects use invalidation contexts to optimize the layout process and avoid unnecessary work. You use this class to specify whether the [`NSCollectionViewFlowLayout`](/documentation/AppKit/NSCollectionViewFlowLayout) object should fetch new size information from its delegate. You can also prevent the flow layout object from updating its layout information altogether.

When you want to invalidate your flow layout object, call the [`invalidationContextClass`](/documentation/AppKit/NSCollectionViewLayout/invalidationContextClass) method of your layout object and instantiate the resulting class. (The implementation of that method in [`NSCollectionViewFlowLayout`](/documentation/AppKit/NSCollectionViewFlowLayout) returns this class.) After instantiating this class, set the properties to appropriate values and pass the object to the [`invalidateLayout(with:)`](/documentation/AppKit/NSCollectionViewLayout/invalidateLayout(with:)) method of the layout object.

## Topics

### Invalidating the Flow Layout

[`invalidateFlowLayoutAttributes`](/documentation/AppKit/NSCollectionViewFlowLayoutInvalidationContext/invalidateFlowLayoutAttributes)

A Boolean value indicating whether the flow layout object should invalidate its current attributes.

[`invalidateFlowLayoutDelegateMetrics`](/documentation/AppKit/NSCollectionViewFlowLayoutInvalidationContext/invalidateFlowLayoutDelegateMetrics)

A Boolean value indicating whether the flow layout object should fetch new size information from its delegate.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSCollectionViewLayoutInvalidationContext`](/documentation/AppKit/NSCollectionViewLayoutInvalidationContext)

---

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)