Created
March 21, 2018 11:51
-
-
Save olbrichj/02fd1d39f1f0a2b5b605a6121f680103 to your computer and use it in GitHub Desktop.
This file contains 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
class ViewController: UIViewController { | |
private let (promise, seal) = Guarantee<...>.pending() | |
func show(in: UIViewController) -> Promise<…> { | |
in.show(self, sender: in) | |
return promise | |
} | |
func done() { | |
dismiss(animated: true) | |
seal.fulfill(…) | |
} | |
} | |
// use: | |
ViewController().show(in: self).done { | |
... | |
}.catch { error in | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment