Skip to content

Instantly share code, notes, and snippets.

@dimebt
Last active January 30, 2019 15:47
Show Gist options
  • Select an option

  • Save dimebt/226aee7e6d1370984420bac2c683b2fb to your computer and use it in GitHub Desktop.

Select an option

Save dimebt/226aee7e6d1370984420bac2c683b2fb to your computer and use it in GitHub Desktop.
fetchJSON(fromURL: "someURL") { (response, results, error) in
switch response {
case .success:
fetchUserData(for: results) { (response, results, error) in
switch response {
case .success:
loginUser(user: results) { (response, results, error) in
switch response {
case .success:
// finialy all of the callbacks are finished
print("Handle logic here")
case .fail:
print(error)
}
}
case .fail:
print(error)
}
}
case .fail:
print(error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment