<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewLayout/indexPathsToInsertForSupplementaryView(ofKind:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewLayout(im)indexPathsToInsertForSupplementaryViewOfKind:"
  },
  "title" : "indexPathsToInsertForSupplementaryView(ofKind:)"
}
-->

# indexPathsToInsertForSupplementaryView(ofKind:)

Retrieves an array of index paths for the supplementary views you want to add to the layout.

```
func indexPathsToInsertForSupplementaryView(ofKind elementKind: String) -> [IndexPath]
```

## Parameters

`elementKind`

The specific type of supplementary view.

## Return Value

An array of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects indicating the location of the new supplementary views, or an empty array if you don’t want to add any supplementary views.

## Discussion

The collection view calls this method whenever you add cells or sections to the collection view. Implementing this method gives your layout object an opportunity to add new supplementary views to complement the additions.

The collection view calls this method between its calls to [`prepare(forCollectionViewUpdates:)`](/documentation/UIKit/UICollectionViewLayout/prepare(forCollectionViewUpdates:)) and [`finalizeCollectionViewUpdates()`](/documentation/UIKit/UICollectionViewLayout/finalizeCollectionViewUpdates()).

---

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)