How am I supposed to chain promises in PromiseKit 3.0 And Swift 2? I'm trying the following code:
let url = "https://httpbin/org/get";
let url2 = "https://httpbin/org/get";
firstly {
NSURLSession.GET(url)
}.then { (json: NSDictionary) in
NSURLSession.GET(url2) // Error in this line
}.then { (json: NSDictionary) in
print("End of second request");
}
But I get the error "Cannot convert value of type 'URLDataPromise' to closure result type 'AnyPromise'" on line 6.
This is basically a sample retrieved from PromiseKit website, it is supposed to work, isn't? What am I doing wrong?