Pagination
public enum Pagination : Decodable
Pagination options.
-
The default value for the pagination limit is 25.
Declaration
Swift
public static let defaultLimit: Int
-
Default limit is 25. (Defined in
FeedPagination.defaultLimit
)Declaration
Swift
case none
-
The amount of activities requested from the APIs.
Declaration
Swift
case limit(_: Int)
-
The offset of requesting activities.
Note
UsinglessThan
orlessThanOrEqual
for pagination is preferable to usingoffset
.Declaration
Swift
case offset(_: Int)
-
Filter the feed on ids greater than the given value.
Declaration
Swift
case greaterThan(_: String)
-
Filter the feed on ids greater than or equal to the given value.
Declaration
Swift
case greaterThanOrEqual(_: String)
-
Filter the feed on ids smaller than the given value.
Declaration
Swift
case lessThan(_: String)
-
Filter the feed on ids smaller than or equal to the given value.
Declaration
Swift
case lessThanOrEqual(_: String)
-
Combine
Pagination
‘s with each other.It’s easy to use with the
+
operator. Examples:var pagination = .limit(10) + .greaterThan("news123") pagination += .lessThan("news987") print(pagination) // It will print: // and(pagination: .and(pagination: .limit(10), another: .greaterThan("news123")), // another: .lessThan("news987"))
Declaration
Swift
indirect case and(pagination: Pagination, another: Pagination)
-
Declaration
Swift
public init(from decoder: Decoder) throws