layoutAttributesForItem(at:)
Gets the layout information for the item at the specified index path.
Declaration
func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?Parameters
- indexPath:
The index path of the item.
Return Value
The layout attributes for the item or nil if no item exists at the specified path.
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.