UICollectionView

public extension UICollectionView
  • Applies multiple animated updates in stages using StagedChangeset.

    Note

    There are combination of changes that crash when applied simultaneously in performBatchUpdates. Assumes that StagedChangeset has a minimum staged changesets to avoid it. The data of the data-source needs to be updated synchronously before performBatchUpdates in every stages.

    Declaration

    Swift

    func reload<C>(
        using stagedChangeset: StagedChangeset<C>,
        interrupt: ((Changeset<C>) -> Bool)? = nil,
        setData: (C) -> Void
        )

    Parameters

    stagedChangeset

    A staged set of changes.

    interrupt

    A closure that takes an changeset as its argument and returns true if the animated updates should be stopped and performed reloadData. Default is nil.

    setData

    A closure that takes the collection as a parameter. The collection should be set to data-source of UICollectionView.