---
title: snapshotForExpandingParentItemHandler
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionviewdiffabledatasourcesectionsnapshothandlers/snapshotforexpandingparentitemhandler
---

# snapshotForExpandingParentItemHandler

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

## Declaration

```occ
@property (nonatomic, copy, nullable) NSDiffableDataSourceSectionSnapshot<id> * (^snapshotForExpandingParentItemHandler)(ItemType , NSDiffableDataSourceSectionSnapshot<id> *);
```

## Discussion

Discussion Use the snapshotForExpandingParentItemHandler handler to customize the snapshot that returns when a particular parent item is expanded. // Allow every item to be collapsed dataSource.sectionSnapshotHandlers.shouldCollapseItem = { item in return true }

dataSource.sectionSnapshotHandlers.snapshotForExpandingParent = {     parent, existingSnapshot -> NSDiffableDataSourceSectionSnapshot<String> in          // Return child snapshot for the parent, or just existingSnapshot }

## See Also

### Expanding and collapsing items

- [shouldCollapseItemHandler](uikit/uicollectionviewdiffabledatasourcesectionsnapshothandlers/shouldcollapseitemhandler.md)
- [shouldExpandItemHandler](uikit/uicollectionviewdiffabledatasourcesectionsnapshothandlers/shouldexpanditemhandler.md)
- [willCollapseItemHandler](uikit/uicollectionviewdiffabledatasourcesectionsnapshothandlers/willcollapseitemhandler.md)
- [willExpandItemHandler](uikit/uicollectionviewdiffabledatasourcesectionsnapshothandlers/willexpanditemhandler.md)
