---
title: "layoutAttributesForItem(at:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionview/layoutattributesforitem(at:)"
---

# layoutAttributesForItem(at:)

Gets the layout information for the item at the specified index path.

## Declaration

```swift
func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?
```

## Parameters

- `indexPath`: The index path of the item.

## Return Value

Return Value The layout attributes for the item or nil if no item exists at the specified path.

## Discussion

Discussion Use this method to retrieve the layout information for a particular item. You should always use this method instead of querying the layout object directly.

## See Also

### Getting layout information

- [layoutAttributesForSupplementaryElement(ofKind:at:)](uikit/uicollectionview/layoutattributesforsupplementaryelement(ofkind:at:).md)
