(At least according to the docs/undocmented.json file created by jazzy.)
Also attemps to unify the documentation style, fixes typos found in
documentation, and adds some functional tests for PMKJoint.
Having to specialize your thens makes using PromiseKit much less pleasant.
However naming our functions more verbosely, for example:
CLLocationManager.promiseLocations()
// versus
CLLocationManager.promiseLocation()
Read confusingly. This new idea allows promises to be non-ambiguous yet
specialization is easy. For example:
NSURLSession.GET(url).then { data in } // no compiler ambiguity!
// or:
NSURLSession.GET(url).asImage().then { image in }
Swift sources can specify errors to be Cancellable using this more elegant protocol system.
registerCancel… still exists as not all NSErrors can be represented as ErrorTypes directly.
Swift no longer has access to NSError.cancelledError() and does not have an ErrorType replacement. If you are writing Swift it is trivial to make your own custom CancellableErrorType and this is the “Swift-Way”.
Since ErrorType is not (necessarily) an NSObject we needed to handle the unhandled tokens differently.
Instead we keep an ErrorConsumptionToken with the ErrorType and ensure we pass it around with subsequent promises.
This appears to work for all possible Swift paths and thus I think it will work for all ObjC paths too and it may be worth switching to this system.
The reason the other system was used (add a runtime iVar) is so that errors that are consumed but then end up going back into the a chain are known to already be consumed. However with further realization it is apparent that any error that goes back into a chain is unconsumed and thus the new system should be work well in all cases.