<!--
{
  "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/UICollectionViewLayoutInvalidationContext/invalidateDataSourceCounts",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewLayoutInvalidationContext(py)invalidateDataSourceCounts"
  },
  "title" : "invalidateDataSourceCounts"
}
-->

# invalidateDataSourceCounts

A Boolean that indicates whether the layout should ask for new section and item counts.

```
var invalidateDataSourceCounts: Bool { get }
```

## Discussion

You do not set this property yourself. The collection view sets it in response to specific types of layout invalidation scenarios.  For example, the collection view sets it to <doc://com.apple.documentation/documentation/Swift/true> when you insert or delete items or call the collection view’s [`reloadData()`](/documentation/UIKit/UICollectionView/reloadData()) method.

If this property is set to <doc://com.apple.documentation/documentation/Swift/true>, the layout object should query its delegate for the number of sections and items and update its layout based on the new number of items.

---

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)