ArrayDataProvider
public final class ArrayDataProvider<ContentElement> : CollectionDataProvider
ArrayDataProvider provides basic implementation to map arrays to a DataProvider.
Seealso
CollectionDataProvider
-
Declaration
Swift
public typealias Element = ContentElement -
The content which is provided by the data provider
Declaration
Swift
public var content: [[Element]] -
An observable where one can subscribe to changes of data provider.
Declaration
Swift
public var observable: DataProviderObservable { get }
-
Creates an instance of
ArrayDataProviderwith a flat collection which results a single section.Declaration
Swift
public convenience init(rows: [Element])Parameters
rowssingle section of content.
-
Creates an empty
ArrayDataProvider.Declaration
Swift
public convenience init() -
Creates an instance of
ArrayDataProviderwith an 2D array which results in a multiple sections.Declaration
Swift
public init(sections: [[Element]])Parameters
sections2D array.
-
Reconfigures the data provider with new content.
Declaration
Swift
public func reconfigure(with rows: [Element], change: DataProviderChange = .unknown)Parameters
arrayflat array.
changediff of the new data.
-
Reconfigures the data provider with new content.
Declaration
Swift
public func reconfigure(with array: [[Element]], change: DataProviderChange = .unknown)Parameters
array2D array.
changediff of the new data.
View on GitHub
ArrayDataProvider Class Reference