UITableView

public extension UITableView
  • 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>,
        with animation: @autoclosure () -> RowAnimation,
        interrupt: ((Changeset<C>) -> Bool)? = nil,
        setData: (C) -> Void
        )

    Parameters

    stagedChangeset

    A staged set of changes.

    animation

    An option to animate the updates.

    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 UITableView.

  • 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>,
        deleteSectionsAnimation: @autoclosure () -> RowAnimation,
        insertSectionsAnimation: @autoclosure () -> RowAnimation,
        reloadSectionsAnimation: @autoclosure () -> RowAnimation,
        deleteRowsAnimation: @autoclosure () -> RowAnimation,
        insertRowsAnimation: @autoclosure () -> RowAnimation,
        reloadRowsAnimation: @autoclosure () -> RowAnimation,
        interrupt: ((Changeset<C>) -> Bool)? = nil,
        setData: (C) -> Void
        )

    Parameters

    stagedChangeset

    A staged set of changes.

    deleteSectionsAnimation

    An option to animate the section deletion.

    insertSectionsAnimation

    An option to animate the section insertion.

    reloadSectionsAnimation

    An option to animate the section reload.

    deleteRowsAnimation

    An option to animate the row deletion.

    insertRowsAnimation

    An option to animate the row insertion.

    reloadRowsAnimation

    An option to animate the row reload.

    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 UITableView.