DataSource

public class DataSource<S, T> : NSObject, UITableViewDataSource where T : UITableViewCellGenerator

Undocumented

  • A populator is a function that defines an interaction between Provider and DataSource to process and populate a datasource given responses from a service provider.

    Declaration

    Swift

    public typealias Populator = (MoyaProvider<S>, DataSource<S, T>) -> Void
  • Undocumented

    Declaration

    Swift

    public var nextResourceIdentifier: String?
  • Undocumented

    Declaration

    Swift

    public var entries: [T]
  • Fill the datasource with entities of type T.

    Declaration

    Swift

    public func fill()
  • Undocumented

    Declaration

    Swift

    public func drain()
  • Regenerate the datasource.

    Declaration

    Swift

    public func regenerate()
  • Append entities of type T to the datasource.

    Declaration

    Swift

    public func append(_ entities: [T])

    Parameters

    entities

    array of entities of type T

  • Initialize a datasource with a population method.

    Declaration

    Swift

    public init(_ p: @escaping Populator)

    Parameters

    p

    population method implementation.

  • Undocumented

    Declaration

    Swift

    public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
  • Undocumented

    Declaration

    Swift

    public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell