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

# indexPathsToInsertForDecorationView(ofKind:)

Retrieves an array of index paths representing the decoration views to add.

## Declaration

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

## Parameters

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

## Return Value

Return Value An array of NSIndexPath objects indicating the location of the new decoration views or an empty array if you do not want to add any decoration 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 decoration 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)
- [indexPathsToInsertForSupplementaryView(ofKind:)](uikit/uicollectionviewlayout/indexpathstoinsertforsupplementaryview(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)
