CollectionDataProvider
public protocol CollectionDataProvider : DataProvider
CollectionDataProvider provides an interface for data providers which rely on a collection as internal data structure.
By conforming to this protocol you get most of the DataProvider requirements already implemented.
See also
ArrayDataProvider
See also
AnyCollectionDataProvider
-
Undocumented
Declaration
Swift
associatedtype Container : Collection where Self.Element == Self.Container.Element.Element, Self.Container.Element : Collection -
The content which is provided by the data provider
Declaration
Swift
var content: Container { get } -
numberOfSections()Extension methodReturn the number of sections.
Declaration
Swift
func numberOfSections() -> IntReturn Value
the number of sections.
-
object(at:Extension method) Returns an object for a given index path.
Declaration
Swift
func object(at indexPath: IndexPath) -> ElementParameters
indexPaththe index path to get the object for.
Return Value
the object at the given index path.
-
numberOfItems(inSection:Extension method) Returns the number of items in a given section.
Declaration
Swift
func numberOfItems(inSection section: Int) -> IntParameters
sectionthe section.
Return Value
number of items in the given section.
-
indexPath(for:Extension method) Returns the indexPath for a given object.
- return: the indexPath of the object, if available.
Declaration
Swift
func indexPath(for object: Element) -> IndexPath?Parameters
objectthe object to find the indexPath for.
View on GitHub
CollectionDataProvider Protocol Reference