LazyTransformationDataProvider

public final class LazyTransformationDataProvider<TargetType> : DataProvider

Takes a data provider and transforms it with a given closure into a new data provider with a different type.

Note

Transformation will only execute when an object is requested by calling object(at:).

Init

Protocol DataProvider

  • An observable where one can subscribe to changes of data provider.

    Declaration

    Swift

    public var observable: DataProviderObservable
  • Returns an object for a given index path.

    Declaration

    Swift

    public func object(at indexPath: IndexPath) -> TargetType

    Parameters

    indexPath

    the index path to get the object for.

    Return Value

    the object at the given index path.

  • Returns the number of items in a given section.

    Declaration

    Swift

    public func numberOfItems(inSection section: Int) -> Int

    Parameters

    section

    the section.

    Return Value

    number of items in the given section.

  • Return the number of sections.

    Declaration

    Swift

    public func numberOfSections() -> Int

    Return Value

    the number of sections.