<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/SectionSnapshotHandlers-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit34UICollectionViewDiffableDataSourceC23SectionSnapshotHandlersV"
  },
  "title" : "UICollectionViewDiffableDataSource.SectionSnapshotHandlers"
}
-->

# UICollectionViewDiffableDataSource.SectionSnapshotHandlers

Handlers for expanding and collapsing items.

```
@preconcurrency struct SectionSnapshotHandlers<ItemIdentifierType> where ItemIdentifierType : Hashable, ItemIdentifierType : Sendable
```

## Topics

### Expanding and collapsing items

[`shouldCollapseItem`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/SectionSnapshotHandlers-swift.struct/shouldCollapseItem)

The handler that determines whether a particular item is collapsable.

[`shouldExpandItem`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/SectionSnapshotHandlers-swift.struct/shouldExpandItem)

The handler that determines whether a particular item is expandable.

[`willCollapseItem`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/SectionSnapshotHandlers-swift.struct/willCollapseItem)

The handler that prepares the diffable data source for collapsing an item.

[`willExpandItem`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/SectionSnapshotHandlers-swift.struct/willExpandItem)

The handler that prepares the diffable data source for expanding an item.

[`snapshotForExpandingParent`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/SectionSnapshotHandlers-swift.struct/snapshotForExpandingParent)

The handler that provides the section snapshot for expanding the parent item.



---

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)