UICollectionViewUpdater
open class UICollectionViewUpdater<Adapter> : Updater where Adapter : UICollectionViewAdapter
An updater for managing diffing updates to render data to the UICollectionView.
-
A Bool value indicating whether that enable diffing animation. Default is true.
Declaration
Swift
open var isAnimationEnabled: Bool -
A Bool value indicating whether that enable diffing animation while target is scrolling. Default is false.
Declaration
Swift
open var isAnimationEnabledWhileScrolling: Bool -
A Bool value indicating whether that to always render visible components after diffing updated. Default is true.
Declaration
Swift
open var alwaysRenderVisibleComponents: Bool -
A Bool value indicating whether that to reset content offset after updated if not scrolling. Default is true.
Declaration
Swift
open var keepsContentOffset: Bool -
Max number of changes that can be animated for diffing updates. Default is 300.
Declaration
Swift
open var animatableChangeCount: Int -
A completion handler to be called after each updates.
Declaration
Swift
open var completion: (() -> Void)? -
Create a new updater.
Declaration
Swift
public init() -
Set the
delegateanddataSourceof given collection view, then reload data and invalidate layout.Declaration
Swift
open func prepare(target: UICollectionView, adapter: Adapter)Parameters
targetA target to be prepared.
adapterAn adapter to be set to
delegateanddataSource. -
Perform updates to render given data to the target. The completion is expected to be called after all updates and the its animations.
Declaration
Parameters
targetA target instance to be updated to render given data.
adapterAn adapter holding currently rendered data.
dataA collection of sections to be rendered next.
-
Perform diffing updates to render given data to the target.
Declaration
Swift
open func performDifferentialUpdates(target: UICollectionView, adapter: Adapter, stagedChangeset: StagedDataChangeset)Parameters
targetA target instance to be updated to render given data.
adapterAn adapter holding currently rendered data.
stagedChangesetA staged set of changes of current data and next data.
-
Renders components displayed in visible area again.
Declaration
Swift
open func renderVisibleComponents(in target: UICollectionView, adapter: Adapter)Parameters
targetA target instance to render components.
adapterAn adapter holding currently rendered data.
View on GitHub
UICollectionViewUpdater Class Reference