PageLoaderTableViewDelegate

open class PageLoaderTableViewDelegate<CellType: UITableViewCell, Type: Equatable>: TableViewBlockDelegate<CellType, Type>
    where CellType: Configurable

Basic UITableViewDelegate abstracting paging. When the TableView is scrolled to the bottom, will check if should fetch the next page.

  • Inits the Delegate.

    Declaration

    Swift

    public required init(with dataSource: TableViewArrayDataSource<CellType, Type>,
                         onSelected: @escaping ((Type) -> Void),
                         shouldLoadNextPage: @escaping (() -> Bool),
                         loadNextPage: @escaping (() -> Void))

    Parameters

    with

    DataSource backing the TableView, where data will be extracted from.

    onSelected

    Logic to handle value selection.

    shouldLoadNextPage

    Validation logic for page loading.

    loadNextPage

    Logic to load next page.

  • UIScrollView Delegate method. Called when the scrolling ends.

    Declaration

    Swift

    public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView)

    Parameters

    scrollView

    Where the scrolling slowed.