Pagination
public struct Pagination
A structure representing the parameters for paginating the elements of a larger collection.
-
The number of items to be contained in the page.
Declaration
Swift
public var limit: Int
-
The index of the first item to be contained in the page.
If
nil
or no value is supplied, then the first item in the page will represent the first item in the overall collection (i.e., the item at index0
).Declaration
Swift
public var offset: Int?
-
Creates a set of pagination parameters based on limit and offset.
Declaration
Swift
public init(limit: Int, offset: Int? = nil)
Parameters
limit
The number of items to be contained in the page. The maximum value for any given request is 50 items.
offset
The index of the first item contained in the page. The default value is
nil
, meaning that the first item in the overall collection will be the first item in the page (i.e., the item at index0
). -
Creates a set of pagination parameters based on limit and page number.
Declaration
Swift
public init(limit: Int, page: Int)
Parameters
limit
The number of items to be contained in the page. The maximum value for any given request is 50 items.
page
The page
number,
based on the number of items in each page. For example, with limit of 20, page 1 would contain items at indices 0-19, page 2 would contain items at indices 20-39, and so on.