<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/makeSupplementaryView(ofKind:withIdentifier:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(im)makeSupplementaryViewOfKind:withIdentifier:forIndexPath:"
  },
  "title" : "makeSupplementaryView(ofKind:withIdentifier:for:)"
}
-->

# makeSupplementaryView(ofKind:withIdentifier:for:)

Creates or returns a reusable supplementary view of the specified type.

```
func makeSupplementaryView(ofKind elementKind: NSCollectionView.SupplementaryElementKind, withIdentifier identifier: NSUserInterfaceItemIdentifier, for indexPath: IndexPath) -> NSView
```

## Parameters

`elementKind`

The kind of supplementary view to create. This value is defined by the layout object. This parameter must not be an empty string or `nil`.

`identifier`

The reuse identifier for the specified item. This is the identifier you specified when registering the supplementary view. This parameter must not be `nil`.

`indexPath`

The index path specifying the location of the supplementary view. The data source object receives this information in its [`collectionView(_:viewForSupplementaryElementOfKind:at:)`](/documentation/AppKit/NSCollectionViewDataSource/collectionView(_:viewForSupplementaryElementOfKind:at:)) method and you should just pass it along.

## Return Value

A view that adopts the [`NSCollectionViewElement`](/documentation/AppKit/NSCollectionViewElement) protocol.

## Discussion

This method looks for a recycled supplementary view of the specified type and returns it if one exists. If one does not exist, it creates it using one of the following techniques:

- If you used the [`register(_:forSupplementaryViewOfKind:withIdentifier:)`](/documentation/AppKit/NSCollectionView/register(_:forSupplementaryViewOfKind:withIdentifier:)-3dqa) method to register a class for the identifier, this method instantiates your view class and returns it.
- If you used the [`register(_:forSupplementaryViewOfKind:withIdentifier:)`](/documentation/AppKit/NSCollectionView/register(_:forSupplementaryViewOfKind:withIdentifier:)-7gvf2) method to register a nib file for the identifier, this method loads the view from the nib file and returns it.

---

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)