---
title: invalidateDataSourceCounts
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionviewlayoutinvalidationcontext/invalidatedatasourcecounts
---

# invalidateDataSourceCounts

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

## Declaration

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

## Discussion

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 true when you insert or delete items or call the collection view’s reloadData() method. If this property is set to 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.

## See Also

### Invalidating the Collection View Data

- [invalidateEverything](uikit/uicollectionviewlayoutinvalidationcontext/invalidateeverything.md)
