Replace deeply nested callback handlers in an iOS app with a clean readable chain of async steps.
Chain a location lookup, image download, and UI update in sequence without nesting completion handlers.
Add promise-based wrappers around Apple APIs like URLSession and CoreLocation in an existing Swift project.
PromiseKit is a Swift and Objective-C library that makes it easier to write code that runs tasks in the background, like fetching data from the internet or asking for a user's location. Normally, this kind of code requires writing functions inside functions inside functions, which quickly becomes difficult to read and maintain. PromiseKit offers a cleaner approach: you describe each step in a chain, and the library takes care of running them in order, passing results from one step to the next. The idea behind a "promise" is simple: it is a placeholder for a value that will arrive later. When you fetch an image from a URL, for example, the network call returns a promise. You can then describe what to do when the image arrives, what to do when everything is finished regardless of success or failure, and what to do if something goes wrong. This reads more like a list of instructions than a tangle of nested callbacks. PromiseKit works on iOS, macOS, tvOS, watchOS, and Linux. It includes ready-made promise wrappers for many of Apple's own APIs, so instead of writing the usual callback boilerplate for a network request or a location lookup, you get a single promise back. Optional extensions cover areas like MapKit, CoreLocation, and URLSession. You can install it with CocoaPods, Carthage, or Swift Package Manager. The library has been available for many years and appears in many widely used apps. The README notes that as of Swift 5.5, Apple added its own built-in system for background tasks called async/await, and it points toward a separate project called Async+ for developers who want a similar style using that newer approach. PromiseKit itself continues to be maintained for codebases that have not yet moved to async/await.
← mxcl on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.