UITableViewUpdater

open class UITableViewUpdater<Adapter> : Updater where Adapter : UITableViewAdapter

An updater for managing diffing updates to render data to the UITableView.

  • An animation for section deletions. Default is fade.

    Declaration

    Swift

    open var deleteSectionsAnimation: UITableView.RowAnimation
  • An animation for section insertions. Default is fade.

    Declaration

    Swift

    open var insertSectionsAnimation: UITableView.RowAnimation
  • An animation for section reloads. Default is fade.

    Declaration

    Swift

    open var reloadSectionsAnimation: UITableView.RowAnimation
  • An animation for row deletions. Default is fade.

    Declaration

    Swift

    open var deleteRowsAnimation: UITableView.RowAnimation
  • An animation for row insertions. Default is fade.

    Declaration

    Swift

    open var insertRowsAnimation: UITableView.RowAnimation
  • An animation for row reloads. Default is fade.

    Declaration

    Swift

    open var reloadRowsAnimation: UITableView.RowAnimation
  • 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 given animation to all kind of diffing updates.

    Declaration

    Swift

    open func set(allAnimation animation: UITableView.RowAnimation)
  • Set the delegate and dataSource of given table view, then reload data.

    Declaration

    Swift

    open func prepare(target: UITableView, adapter: Adapter)

    Parameters

    target

    A target to be prepared.

    adapter

    An adapter to be set to delegate and dataSource.

  • Perform updates to render given data to the target. The completion is expected to be called after all updates and the its animations.

    Declaration

    Swift

    open func performUpdates(target: UITableView, adapter: Adapter, data: [Section])

    Parameters

    target

    A target instance to be updated to render given data.

    adapter

    An adapter holding currently rendered data.

    data

    A collection of sections to be rendered next.

  • Perform diffing updates to render given data to the target.

    Declaration

    Swift

    open func performDifferentialUpdates(target: UITableView, adapter: Adapter, stagedChangeset: StagedDataChangeset)

    Parameters

    target

    A target instance to be updated to render given data.

    adapter

    An adapter holding currently rendered data.

    stagedChangeset

    A staged set of changes of current data and next data.

  • Renders components displayed in visible area again.

    Declaration

    Swift

    open func renderVisibleComponents(in target: UITableView, adapter: Adapter)

    Parameters

    target

    A target instance to render components.

    adapter

    An adapter holding currently rendered data.