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
ArrayDataProvider
with a flat collection which results a single section.Declaration
Swift
public convenience init(rows: [Element])
Parameters
rows
single section of content.
-
Creates an empty
ArrayDataProvider
.Declaration
Swift
public convenience init()
-
Creates an instance of
ArrayDataProvider
with an 2D array which results in a multiple sections.Declaration
Swift
public init(sections: [[Element]])
Parameters
sections
2D array.
-
Reconfigures the data provider with new content.
Declaration
Swift
public func reconfigure(with rows: [Element], change: DataProviderChange = .unknown)
Parameters
array
flat array.
change
diff of the new data.
-
Reconfigures the data provider with new content.
Declaration
Swift
public func reconfigure(with array: [[Element]], change: DataProviderChange = .unknown)
Parameters
array
2D array.
change
diff of the new data.