<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewSupplementaryRegistration",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewSupplementaryRegistration"
  },
  "title" : "UICollectionViewSupplementaryRegistration"
}
-->

# UICollectionViewSupplementaryRegistration

A registration for the collection view’s supplementary views.

```
@interface UICollectionViewSupplementaryRegistration : NSObject
```

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

```objc
UICollectionViewSupplementaryRegistration *headerRegistration = [UICollectionViewSupplementaryRegistration registrationWithSupplementaryClass:[HeaderView class] elementKind:@"Header" configurationHandler:^(HeaderView *supplementaryView, NSString *elementKind, NSIndexPath *indexPath) {
    supplementaryView.label.text = [NSString stringWithFormat:@"%@ for section %ld", elementKind, (long)indexPath.section];
    supplementaryView.backgroundColor = UIColor.lightGrayColor;
}];
```

After you create a supplementary registration, you pass it in to [`dequeueConfiguredReusableSupplementaryViewWithRegistration:forIndexPath:`](/documentation/UIKit/UICollectionView/dequeueConfiguredReusableSupplementaryViewWithRegistration:forIndexPath:), which you call from your data source’s [`supplementaryViewProvider`](/documentation/UIKit/UICollectionViewDiffableDataSource-9tqpa/supplementaryViewProvider-swift.property).

```objc
self.dataSource.supplementaryViewProvider = ^UICollectionReusableView *(UICollectionView *collectionView, NSString *elementKind, NSIndexPath *indexPath) {
    return [collectionView dequeueConfiguredReusableSupplementaryViewWithRegistration:headerRegistration forIndexPath: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 [`dequeueConfiguredReusableSupplementaryViewWithRegistration:forIndexPath:`](/documentation/UIKit/UICollectionView/dequeueConfiguredReusableSupplementaryViewWithRegistration:forIndexPath:).

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

## Topics

### Creating a supplementary registration

[`+ (instancetype) registrationWithSupplementaryClass:(Class) supplementaryClass elementKind:(NSString *) elementKind configurationHandler:(UICollectionViewSupplementaryRegistrationConfigurationHandler) configurationHandler;`](/documentation/UIKit/UICollectionViewSupplementaryRegistration/registrationWithSupplementaryClass:elementKind:configurationHandler:)

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

[`+ (instancetype) registrationWithSupplementaryNib:(UINib *) supplementaryNib elementKind:(NSString *) elementKind configurationHandler:(UICollectionViewSupplementaryRegistrationConfigurationHandler) configurationHandler;`](/documentation/UIKit/UICollectionViewSupplementaryRegistration/registrationWithSupplementaryNib:elementKind:configurationHandler:)

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

[`typedef void (^)(__kindof UICollectionReusableView *, NSString *, NSIndexPath *) UICollectionViewSupplementaryRegistrationConfigurationHandler;`](/documentation/UIKit/UICollectionViewSupplementaryRegistrationConfigurationHandler)

A block that handles the supplementary view registration and configuration.

### Querying a supplementary registration

[`@property (nonatomic, readonly) UICollectionViewSupplementaryRegistrationConfigurationHandler configurationHandler;`](/documentation/UIKit/UICollectionViewSupplementaryRegistration/configurationHandler)

The block that handles the supplementary view registration and configuration.

[`@property (nonatomic, readonly) NSString * elementKind;`](/documentation/UIKit/UICollectionViewSupplementaryRegistration/elementKind)

The supplementary view’s element kind.

[`@property (nonatomic, readonly, nullable) Class supplementaryClass;`](/documentation/UIKit/UICollectionViewSupplementaryRegistration/supplementaryClass)

The class associated with the supplementary view.

[`@property (nonatomic, readonly, nullable) UINib * supplementaryNib;`](/documentation/UIKit/UICollectionViewSupplementaryRegistration/supplementaryNib)

The nib file associated with the supplementary view.

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)