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

# initialLayoutAttributesForAppearingDecorationElement(ofKind:at:)

Retrieves the starting layout information for a decoration view being inserted into the collection view.

```
func initialLayoutAttributesForAppearingDecorationElement(ofKind elementKind: String, at decorationIndexPath: IndexPath) -> UICollectionViewLayoutAttributes?
```

## Parameters

`elementKind`

A string that identifies the type of decoration view.

`decorationIndexPath`

The index path of the item being inserted.

## Return Value

A layout attributes object that describes the position at which to place the corresponding decoration view.

## Discussion

This method is called after the [`prepare(forCollectionViewUpdates:)`](/documentation/UIKit/UICollectionViewLayout/prepare(forCollectionViewUpdates:)) method and before the [`finalizeCollectionViewUpdates()`](/documentation/UIKit/UICollectionViewLayout/finalizeCollectionViewUpdates()) method for any decoration views that are about to be inserted. Your implementation should return the layout information that describes the initial position and state of the view. The collection view uses this information as the starting point for any animations. (The end point of the animation is the view’s new location in the collection view.) If you return `nil`, the layout object uses the item’s final attributes for both the start and end points of the animation.

The default implementation of this method returns `nil`.

---

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)