Created
August 5, 2018 18:53
-
-
Save vialyx/3b48357a102c72c9caba277c4646a92b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias ItemsAndErrorResult = (items: [String], error: Error?) | |
func download(from index: Int, with offset: Int) -> ItemsAndErrorResult { | |
guard index < 100 else { | |
return ([], NSError(domain: "com.vialyx.course", code: -987, userInfo: nil)) | |
} | |
let items = Array(repeating: "result_\(index)", count: offset) | |
return (items, nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment