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
first
The first page of results.
previous
The previous page of results.
next
The next page of results.
last
The last page of results.
-
Initializes a new instance from the headers of an API response.
Declaration
Swift
public init?(headers: [AnyHashable : Any])
Parameters
headers
The 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
response
An instance of
URLResponse
.