ABSDKPagedArrayDataSource
final public class ABSDKPagedArrayDataSource<Query, Data> : ABSDKArrayDataSource<Query, Data> where Query : GraphQLPagedQuery
A ABSDKArrayDataSource that supports paging
-
Flag indicates whether there’re more pages
Declaration
Swift
public var hasMore: Bool
-
Flag indicates is the data source currently loading a page
Declaration
Swift
public var isLoading: Bool
-
Init a paged array data source
Declaration
Swift
public init(client: ABSDKClient, query: Query, dataSourceMapper: @escaping ArrayDataSourceMapper<Query, Data>, dataSourceUpdateHandler: @escaping DataSourceUpdateHandler, arrayDataKeyEqualChecker: ArrayDataKeyEqualChecker<Data>? = nil, pageMapper: @escaping PageMapper<Query>)
Parameters
client
An ABSDKClient for sending requests
query
A GraphQL query to get the array
dataSourceMapper
A callback to extract the concerned array from the query result
dataSourceUpdateHandler
A callback that gets called whenever the concerned array gets update
arrayDataKeyEqualCHecker
An optional callback to check whether two elements in the concerned array are with the same key. This is used to calculate the row changes to update view dynamically.
pageMapper
A callback to extract page info from the query result
-
Load from the first page again
Declaration
Swift
public func refresh()
-
Load next page
Declaration
Swift
public func loadMore()