Type Property


Returns the class to use when creating layout attributes objects.


class var layoutAttributesClass: AnyClass { get }

Return Value

The class to use for layout attributes objects.


If you subclass UICollectionViewLayoutAttributes in order to manage additional layout attributes, you should override this method and return your custom subclass. The methods for creating layout attributes use this class when creating new layout attributes objects.

This method is intended for subclassers only and does not need to be called by your code.

See Also

Providing Layout Attributes

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.