123456789101112131415161718192021222324252627282930313233343536 |
- //
- // GifListPagination.swift
- import Foundation
- struct GifListPagination: Codable {
-
- let offset: Int
- let totalCount: Int
- let count: Int
-
- var nextOffset: Int {
- return offset + count
- }
-
- var canLoadMore: Bool {
- return offset == 0 || self.count == Constants.GiphyPaginationLimit
- }
- init() {
- offset = 0
- totalCount = 0
- count = 0
- }
-
- }
- extension GifListPagination {
-
- enum CodingKeys: String, CodingKey {
- case offset = "offset"
- case totalCount = "total_count"
- case count = "count"
- }
-
- }
|