---
title: NSCollectionViewDiffableDataSource.ItemProvider
framework: appkit
role: symbol
role_heading: Type Alias
path: appkit/nscollectionviewdiffabledatasource-axww/itemprovider
---

# NSCollectionViewDiffableDataSource.ItemProvider

A closure that configures and returns an item for a collection view from its diffable data source.

## Declaration

```swift
typealias ItemProvider = (NSCollectionView, IndexPath, ItemIdentifierType) -> NSCollectionViewItem?
```

## Parameters

- `collectionView`: The collection view to configure this item for.
- `indexPath`: The index path that specifies the location of the item in the collection view.
- `itemIdentifier`: The identifier of the data item for this item.

## Return Value

Return Value A non-nil configured item object. The item provider must return a valid item object to the collection view.

## See Also

### Creating a Diffable Data Source

- [init(collectionView:itemProvider:)](appkit/nscollectionviewdiffabledatasource-axww/init(collectionview:itemprovider:).md)
