CBGPromise is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CBGPromise"
import CBGPromise
class Test {
func getToken() -> Future<String> {
let promise = Promise<String>()
doAsyncCall {
promise.resolve("Test")
}
return promise.future
}
func printToken() {
getToken().then { token in
print(token)
}
}
}
Can Berk Güder
CBGPromise is available under the MIT license. See the LICENSE file for more info.