TableViewDiffCalculator

public final class TableViewDiffCalculator<Section: Equatable, Value: Equatable>: AbstractDiffCalculator<Section, Value>

This class manages a UITableView’s rows and sections. It will make the necessary calls to the table view to ensure that its UI is kept in sync with the contents of the sectionedValues property.

  • The table view to be managed

    Declaration

    Swift

    public weak var tableView: UITableView?
  • Initializes a new diff calculator.

    Declaration

    Swift

    public init(tableView: UITableView?, initialSectionedValues: SectionedValues<Section, Value> = SectionedValues())

    Parameters

    tableView

    the table view to be managed

    initialSectionedValues

    optional - if specified, these will be the initial contents of the diff calculator.

  • You can change insertion/deletion animations like this! Fade works well. So does Top/Bottom. Left/Right/Middle are a little weird, but hey, do your thing.

    Declaration

    Swift

    public var insertionAnimation = UITableViewRowAnimation.automatic, deletionAnimation = UITableViewRowAnimation.automatic