DataSourceProvider

public final class DataSourceProvider < DataSource: DataSourceProtocol,
    CellConfig: ReusableViewConfigProtocol,
    SupplementaryConfig: ReusableViewConfigProtocol>
where CellConfig.Item == DataSource.Item, SupplementaryConfig.Item == DataSource.Item

A DataSourceProvider is responsible for providing a data source object for a table view or collection view.

Properties

  • The data source.

    Declaration

    Swift

    public var dataSource: DataSource
  • The cell configuration.

    Declaration

    Swift

    public let cellConfig: CellConfig
  • The supplementary view configuration.

    Declaration

    Swift

    public let supplementaryConfig: SupplementaryConfig

Initialization

  • Initializes a new data source provider.

    Warning

    Table views do not have supplementary views, but this parameter is still required in order to satisfy the generic constraints for Swift. You can simply pass the same cellConfig here. The parameter will be ignored. The same applies to collection views that do not have supplementary views. Again, the parameter will be ignored.

    Declaration

    Swift

    public init(dataSource: DataSource,
                cellConfig: CellConfig,
                supplementaryConfig: SupplementaryConfig)

    Parameters

    dataSource

    The data source.

    cellConfig

    The cell configuration.

    supplementaryConfig

    The supplementary view configuration.

Available where CellConfig.View: UITableViewCell

  • Initializes a new data source provider.

    Warning

    Table views do not have supplementary views, but this parameter is still required in order to satisfy the generic constraints for Swift. You can simply pass the same cellConfig here. The parameter will be ignored. The same applies to collection views that do not have supplementary views. Again, the parameter will be ignored.

    Declaration

    Swift

    public convenience init(dataSource: DataSource,
                            cellConfig: CellConfig,
                            supplementaryConfig: SupplementaryConfig,
                            tableEditingController: TableEditingController<DataSource>? = nil)

    Parameters

    dataSource

    The data source.

    cellConfig

    The cell configuration.

    supplementaryConfig

    The supplementary view configuration.

    tableEditingController

    The table editing controller.

UITableViewDataSource

  • Returns the UITableViewDataSource object.

    Declaration

    Swift

    public var tableViewDataSource: UITableViewDataSource { get }

UICollectionViewDataSource

  • Returns the UICollectionViewDataSource object.

    Declaration

    Swift

    public var collectionViewDataSource: UICollectionViewDataSource { get }