Contents

prepare(forCollectionViewUpdates:)

Performs needed tasks before items are inserted, deleted, or moved within the collection view.

Declaration

func prepare(forCollectionViewUpdates updateItems: [NSCollectionViewUpdateItem])

Parameters

Discussion

When items are inserted, deleted, or moved, the collection view calls this method to report those changes to the layout object. The default implementation uses the provided information to plan the layout animations needed to respond to the changes. Subclasses can override this method and use it to prepare for any custom changes, but you should always call super at some point in your implementation.

See Also

Responding to Collection View Updates