SingleSectionTableViewDiffCalculator

public final class SingleSectionTableViewDiffCalculator<Value: Equatable>

If your table view only has a single section, or you only want to power a single section of it with Dwifft, use a SingleSectionTableViewDiffCalculator. Note that this approach is not highly recommended, and you should do so only if it really doesn’t make sense to just power your whole table with a TableViewDiffCalculator. You’ll be less likely to mess up the index math :P

  • The table view to be managed

    Declaration

    Swift

    public weak var tableView: UITableView?
  • All insertion/deletion calls will be made on this index.

    Declaration

    Swift

    public let sectionIndex: Int
  • 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
  • Set this variable to automatically trigger the correct row insertion/deletions on your table view.

    Declaration

    Swift

    public var rows : [Value]
  • Initializes a new diff calculator.

    Declaration

    Swift

    public init(tableView: UITableView?, initialRows: [Value] = [], sectionIndex: Int = 0)

    Parameters

    tableView

    the table view to be managed

    initialRows

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

    sectionIndex

    optional - all insertion/deletion calls will be made on this index.