Last active
March 30, 2017 22:13
-
-
Save chelseatroy/3d0c9da1bf175b54ec3dcae34d8b4dbf to your computer and use it in GitHub Desktop.
Asynchronous Calls With FutureKit
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
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