TableViewBlockDelegate

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

Basic UITableViewDelegate abstracting value selection, having elements of type Type and using ConfigurableTableViewCell

  • Inits the Delegate.

    Declaration

    Swift

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

    Parameters

    dataSource

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

    onSelected

    Logic to handle value selection.

  • TableView selection method.

    Declaration

    Swift

    public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)

    Parameters

    tableView

    Where the value was selected.

    indexPath

    The selected row to be related to the selected value.