ArrayDataSource
open class ArrayDataSource<Type> : NSObject where Type : Equatable
Array-based generic data source having elements of type Type
.
-
DataProvider
for this object. As ArrayDataSource is array-based, the data provider is array-based as well.Declaration
Swift
open var dataProvider: ArrayDataProvider<Type>
-
Block to be called whenever
refresh()
method is called.Declaration
Swift
open var onRefresh: (() -> Void)?
-
Inits with given
DataProvider
.Declaration
Swift
public init(with dataProvider: ArrayDataProvider<Type>)
Parameters
dataProvider
The array-based Data provider.
-
Propagates through
onRefresh
a refresh for interested objects.Declaration
Swift
open func refresh()
-
Returns the object at the given
indexPath
row, if exists.Declaration
Swift
open func object(at indexPath: IndexPath) -> Type?
Parameters
at
The index path.
Return Value
The object of type
Type
at givenindexPath
row, ornil
if not found.