Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Asynchronous Calls With FutureKit
import FutureKit
import UIKit
class VillainsMasterViewController: UIViewController {
let villainService: VillainService?
...
func viewDidLoad() {
villainService?.getVillainList()
.onSuccess() { (apiRootResourceLinks) in
//display villain information in view
}.onCancel {
//tell the user that the villain call got cancelled
}.onFail { (error) in
//show the villain app error page
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment