12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // GifListPagination.swift
- // LiveLikeGiphyChallenge
- //
- // Created by Ljupco Nastevski on 30.1.22.
- //
- 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"
- }
-
- }
|