Instance Method

layoutAttributesForDecorationView(ofKind:at:)

Returns the layout attributes for the specified decoration view.

Declaration

func layoutAttributesForDecorationView(ofKind elementKind: String, at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?

Parameters

decorationViewKind

A string that identifies the type of the decoration view.

indexPath

The index path of the decoration view.

Return Value

A layout attributes object containing the information to apply to the decoration view.

Discussion

If your layout object defines any decoration views, you must override this method and use it to return layout information for those views.

See Also

Providing Layout Attributes

class var layoutAttributesClass: AnyClass

Returns the class to use when creating layout attributes objects.

func prepare()

Tells the layout object to update the current layout.

func layoutAttributesForElements(in: CGRect) -> [UICollectionViewLayoutAttributes]?

Returns the layout attributes for all of the cells and views in the specified rectangle.

func layoutAttributesForItem(at: IndexPath) -> UICollectionViewLayoutAttributes?

Returns the layout attributes for the item at the specified index path.

func layoutAttributesForInteractivelyMovingItem(at: IndexPath, withTargetPosition: CGPoint) -> UICollectionViewLayoutAttributes

Returns the layout attributes of an item when it is being moved interactively by the user.

func targetContentOffset(forProposedContentOffset: CGPoint) -> CGPoint

Returns the content offset to use after an animated layout update or change.