- A framework for mocking paginated calls.
- Decodable struct
- .json file
- A subclass with Type and path to json file
- Carthage
github "eonist/PaginationService"
- Manual Open
.xcodeproj
JSON
["Sublime", "Dave Matthews", "Tom Petty"]
Swift
public class CustomPaginationService: PaginationService<String> {
override open class var filePath: String { return Bundle.main.resourcePath! + "/assets.bundle/items.json" }
private static var __items: [String]?
override public class var _items: [String]? {
get { return __items }
set { __items = newValue }
}
}
CustomPaginationService.getItems(index: 20, length: 50) { success, items in Swift.print("success: \(success) \(items.count)") } // 30
- Add github actions
- Add spm