---
title: UICollectionView.SupplementaryRegistration
framework: uikit
role: symbol
role_heading: Structure
path: uikit/uicollectionview/supplementaryregistration
---

# UICollectionView.SupplementaryRegistration

A registration for the collection view’s supplementary views.

## Declaration

```swift
struct SupplementaryRegistration<Supplementary> where Supplementary : UICollectionReusableView
```

## Overview

Overview Use a supplementary registration to register supplementary views, like headers and footers, with your collection view and configure each view for display. You create a supplementary registration with your supplementary view type and data item type as the registration’s generic parameters, passing in a registration handler to configure the view. In the registration handler, you specify how to configure the content and appearance of that type of supplementary view. The following example creates a supplementary registration for a custom header view subclass. let headerRegistration = UICollectionView.SupplementaryRegistration     <HeaderView>(elementKind: "Header") {     supplementaryView, string, indexPath in     supplementaryView.label.text = "\(string) for section \(indexPath.section)"     supplementaryView.backgroundColor = .lightGray } After you create a supplementary registration, you pass it in to dequeueConfiguredReusableSupplementary(using:for:), which you call from your data source’s supplementaryViewProvider. dataSource.supplementaryViewProvider = { collectionView, elementKind, indexPath in     return collectionView.dequeueConfiguredReusableSupplementary(using: headerRegistration,                                                                  for: indexPath) } You don’t need to call register(_:forSupplementaryViewOfKind:withReuseIdentifier:) or register(_:forSupplementaryViewOfKind:withReuseIdentifier:). The registration occurs automatically when you pass the supplementary view registration to dequeueConfiguredReusableSupplementary(using:for:). important: Don’t create your supplementary view registration inside a UICollectionViewDiffableDataSource.SupplementaryViewProvider closure; doing so prevents reuse, and generates an exception in iOS 15 and higher.

## Topics

### Creating a supplementary registration

- [init(elementKind:handler:)](uikit/uicollectionview/supplementaryregistration/init(elementkind:handler:).md)
- [init(supplementaryNib:elementKind:handler:)](uikit/uicollectionview/supplementaryregistration/init(supplementarynib:elementkind:handler:).md)
- [UICollectionView.SupplementaryRegistration.Handler](uikit/uicollectionview/supplementaryregistration/handler.md)

## See Also

### Creating headers and footers

- [dequeueConfiguredReusableSupplementary(using:for:)](uikit/uicollectionview/dequeueconfiguredreusablesupplementary(using:for:).md)
- [register(_:forSupplementaryViewOfKind:withReuseIdentifier:)](uikit/uicollectionview/register(_:forsupplementaryviewofkind:withreuseidentifier:)-661io.md)
- [register(_:forSupplementaryViewOfKind:withReuseIdentifier:)](uikit/uicollectionview/register(_:forsupplementaryviewofkind:withreuseidentifier:)-9hn73.md)
- [dequeueReusableSupplementaryView(ofKind:withReuseIdentifier:for:)](uikit/uicollectionview/dequeuereusablesupplementaryview(ofkind:withreuseidentifier:for:).md)
