<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionView/CellRegistration",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So16UICollectionViewC5UIKitE16CellRegistrationV"
  },
  "title" : "UICollectionView.CellRegistration"
}
-->

# UICollectionView.CellRegistration

A registration for the collection view’s cells.

```
struct CellRegistration<Cell, Item> where Cell : UICollectionViewCell
```

## Overview

Use a cell registration to register cells with your collection view and configure each cell for display. You create a cell registration with your cell type and data item type as the registration’s generic parameters, passing in a registration handler to configure the cell. In the registration handler, you specify how to configure the content and appearance of that type of cell.

The following example creates a cell registration for cells of type [`UICollectionViewListCell`](/documentation/UIKit/UICollectionViewListCell). It creates a content configuration with a system default style, customizes the content and appearance of the configuration, and then assigns the configuration to the cell.

```swift
let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, Int> { cell, indexPath, item in
    
    var contentConfiguration = cell.defaultContentConfiguration()
    
    contentConfiguration.text = "\(item)"
    contentConfiguration.textProperties.color = .lightGray
    
    cell.contentConfiguration = contentConfiguration
}
```

After you create a cell registration, you pass it in to [`dequeueConfiguredReusableCell(using:for:item:)`](/documentation/UIKit/UICollectionView/dequeueConfiguredReusableCell(using:for:item:)), which you call from your data source’s cell provider.

```swift
dataSource = UICollectionViewDiffableDataSource<Section, Int>(collectionView: collectionView) {
    (collectionView: UICollectionView, indexPath: IndexPath, itemIdentifier: Int) -> UICollectionViewCell? in
    
    return collectionView.dequeueConfiguredReusableCell(using: cellRegistration,
                                                        for: indexPath,
                                                        item: itemIdentifier)
}
```

You don’t need to call [`register(_:forCellWithReuseIdentifier:)`](/documentation/UIKit/UICollectionView/register(_:forCellWithReuseIdentifier:)-6z6t4) or [`register(_:forCellWithReuseIdentifier:)`](/documentation/UIKit/UICollectionView/register(_:forCellWithReuseIdentifier:)-3vaho). The collection view registers your cell automatically when you pass the cell registration to [`dequeueConfiguredReusableCell(using:for:item:)`](/documentation/UIKit/UICollectionView/dequeueConfiguredReusableCell(using:for:item:)).

> Important:
> Don’t create your cell registration inside a ``doc://com.apple.uikit/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/CellProvider`` closure; doing so prevents cell reuse, and generates an exception in iOS 15 and higher.

## Topics

### Creating a cell registration

[`init(handler:)`](/documentation/UIKit/UICollectionView/CellRegistration/init(handler:))

Creates a cell registration with the specified registration handler.

[`init(cellNib:handler:)`](/documentation/UIKit/UICollectionView/CellRegistration/init(cellNib:handler:))

Creates a cell registration with the specified registration handler and nib file.

[`UICollectionView.CellRegistration.Handler`](/documentation/UIKit/UICollectionView/CellRegistration/Handler)

A closure that handles the cell registration and configuration.



---

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)