TableViewArrayDataSource
open class TableViewArrayDataSource<CellType: UITableViewCell, Type: Equatable>: ArrayDataSource<Type>, UITableViewDataSource
where CellType: Configurable
Array-based UITableView data source having elements of type Type and using ConfigurableTableViewCell.
-
TableView that owns this DataSource.
Declaration
Swift
open let tableView: UITableView
-
Inits the DataSource providing a UITableView and its objects. Assumes the ReuseIdentifier will have the same name as
CellTypetype.Declaration
Swift
public convenience init(for tableView: UITableView, with dataProvider: ArrayDataProvider<Type>)Parameters
forThe target UITableView.
dataProviderThe array-based Data provider.
-
Inits the DataSource providing a UITableView and its objects.
Declaration
Swift
public required init(for tableView: UITableView, reuseIdentifier: @escaping ((IndexPath) -> (String)), with dataProvider: ArrayDataProvider<Type>)Parameters
forThe target UITableView.
reuseIdentifierBlock used to define the Ruse Identifier based on the given IndexPath.
dataProviderThe array-based Data provider.
-
Propagates through
onRefresha refresh for interested objects and also callsreloadDataontableView.Declaration
Swift
open override func refresh()
-
Returns the number of rows in its only section. The number of rows always matches the number of contained objects.
Declaration
Swift
open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> IntParameters
tableViewThe target UITableView.
sectionThe desired sections. Values different than
0will result in0being returned.Return Value
number of objects.
-
Returns the number of rows in its only section. The number of rows always matches the number of contained objects.
Declaration
Swift
open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCellParameters
tableViewThe target UITableView.
cellForRowAtThe indexPath for the given object, or
nilif not found.Return Value
number of objects.
View on GitHub
TableViewArrayDataSource Class Reference