Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created August 5, 2018 18:53
Show Gist options
  • Save vialyx/3b48357a102c72c9caba277c4646a92b to your computer and use it in GitHub Desktop.
Save vialyx/3b48357a102c72c9caba277c4646a92b to your computer and use it in GitHub Desktop.
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