Skip to content

Instantly share code, notes, and snippets.

@llinardos
Last active May 8, 2018 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llinardos/27ec21aca6e562e966f199f5ebb6e319 to your computer and use it in GitHub Desktop.
Save llinardos/27ec21aca6e562e966f199f5ebb6e319 to your computer and use it in GitHub Desktop.
class ThingsService {
func getThings() -> Result<[Thing]> {
do {
let response = try sendHttpRequestSynchronously(url)
let data = try getData(from: response)
let things = try doParsing(data)
return .success(things)
} catch error {
return .failure(error)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment