Pagination
public struct Pagination
The Pagination struct represents all the pagination info that can be
returned via an API call, often containing a first, previous, next,
and last page. This struct represents all those pages as Page instances.
-
Initializes the struct with a first, previous, next, and last page.
Declaration
Parameters
firstThe first page of results.
previousThe previous page of results.
nextThe next page of results.
lastThe last page of results.
-
Initializes a new instance from the headers of an API response.
Declaration
Swift
public init?(headers: [AnyHashable : Any])Parameters
headersThe headers of the API response.
-
Initializes a new instance from a URLResponse, extracting the information out of the
Link
header (if present).Declaration
Swift
public init?(response: URLResponse?)Parameters
responseAn instance of
URLResponse.
View on GitHub
Pagination Structure Reference