---
title: "indexPathsToInsertForSupplementaryView(ofKind:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewlayout/indexpathstoinsertforsupplementaryview(ofkind:)"
---

# indexPathsToInsertForSupplementaryView(ofKind:)

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

## Declaration

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

## Parameters

- `elementKind`: The specific type of supplementary view.

## Return Value

Return Value An array of 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

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:) and finalizeCollectionViewUpdates().

## See Also

### Responding to collection view updates

- [prepare(forCollectionViewUpdates:)](uikit/uicollectionviewlayout/prepare(forcollectionviewupdates:).md)
- [finalizeCollectionViewUpdates()](uikit/uicollectionviewlayout/finalizecollectionviewupdates().md)
- [indexPathsToInsertForDecorationView(ofKind:)](uikit/uicollectionviewlayout/indexpathstoinsertfordecorationview(ofkind:).md)
- [initialLayoutAttributesForAppearingItem(at:)](uikit/uicollectionviewlayout/initiallayoutattributesforappearingitem(at:).md)
- [initialLayoutAttributesForAppearingSupplementaryElement(ofKind:at:)](uikit/uicollectionviewlayout/initiallayoutattributesforappearingsupplementaryelement(ofkind:at:).md)
- [initialLayoutAttributesForAppearingDecorationElement(ofKind:at:)](uikit/uicollectionviewlayout/initiallayoutattributesforappearingdecorationelement(ofkind:at:).md)
- [indexPathsToDeleteForSupplementaryView(ofKind:)](uikit/uicollectionviewlayout/indexpathstodeleteforsupplementaryview(ofkind:).md)
- [indexPathsToDeleteForDecorationView(ofKind:)](uikit/uicollectionviewlayout/indexpathstodeletefordecorationview(ofkind:).md)
- [finalLayoutAttributesForDisappearingItem(at:)](uikit/uicollectionviewlayout/finallayoutattributesfordisappearingitem(at:).md)
- [finalLayoutAttributesForDisappearingSupplementaryElement(ofKind:at:)](uikit/uicollectionviewlayout/finallayoutattributesfordisappearingsupplementaryelement(ofkind:at:).md)
- [finalLayoutAttributesForDisappearingDecorationElement(ofKind:at:)](uikit/uicollectionviewlayout/finallayoutattributesfordisappearingdecorationelement(ofkind:at:).md)
- [targetIndexPath(forInteractivelyMovingItem:withPosition:)](uikit/uicollectionviewlayout/targetindexpath(forinteractivelymovingitem:withposition:).md)
