Instance Method

invalidateItems(at:)

Marks the specified items as invalid so that their layout information can be updated.

Declaration

func invalidateItems(at indexPaths: Set<IndexPath>)

Parameters

indexPaths

A set of NSIndexPath objects. Each index path represents an item whose layout needs to be recomputed.

Discussion

Call this method when you want the layout object to recompute attributes for a specific set of items. The items you provide are added to the invalidatedItemIndexPaths property. You can call this method more than once to create a merged set of items.

See Also

Invalidating Specific Items

func invalidateSupplementaryElements(ofKind: NSCollectionView.SupplementaryElementKind, at: Set<IndexPath>)

Marks the specified supplementary views as invalid so that their layout information can be updated.

func invalidateDecorationElements(ofKind: NSCollectionView.DecorationElementKind, at: Set<IndexPath>)

Marks the specified decoration views as invalid so that their layout information can be updated.

var invalidatedItemIndexPaths: Set<IndexPath>?

The set of items whose layout attributes are invalid.

var invalidatedSupplementaryIndexPaths: [NSCollectionView.SupplementaryElementKind : Set<IndexPath>]?

A dictionary containing the supplementary views whose layout attributes are invalid.

var invalidatedDecorationIndexPaths: [NSCollectionView.DecorationElementKind : Set<IndexPath>]?

A dictionary containing the decoration views whose layout attributes are invalid.