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

# UICollectionView.SupplementaryRegistration

A registration for the collection view’s supplementary views.

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

## 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.

```swift
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:)`](/documentation/UIKit/UICollectionView/dequeueConfiguredReusableSupplementary(using:for:)), which you call from your data source’s [`supplementaryViewProvider`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/supplementaryViewProvider-swift.property).

```swift
dataSource.supplementaryViewProvider = { collectionView, elementKind, indexPath in
    return collectionView.dequeueConfiguredReusableSupplementary(using: headerRegistration,
                                                                 for: indexPath)
}
```

You don’t need to call [`register(_:forSupplementaryViewOfKind:withReuseIdentifier:)`](/documentation/UIKit/UICollectionView/register(_:forSupplementaryViewOfKind:withReuseIdentifier:)-661io) or [`register(_:forSupplementaryViewOfKind:withReuseIdentifier:)`](/documentation/UIKit/UICollectionView/register(_:forSupplementaryViewOfKind:withReuseIdentifier:)-9hn73). The registration occurs automatically when you pass the supplementary view registration to [`dequeueConfiguredReusableSupplementary(using:for:)`](/documentation/UIKit/UICollectionView/dequeueConfiguredReusableSupplementary(using:for:)).

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

## Topics

### Creating a supplementary registration

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

Creates a supplementary registration for the specified element kind with a registration handler.

[`init(supplementaryNib:elementKind:handler:)`](/documentation/UIKit/UICollectionView/SupplementaryRegistration/init(supplementaryNib:elementKind:handler:))

Creates a supplementary registration for the specified element kind with a registration handler and nib file.

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

A closure that handles the supplementary view 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)