Skip to content

PromiseKit

A Swift and Objective-C library for writing asynchronous code as promise chains.

Stars
14.2k
Forks
1.5k
Licence
MIT
Language
Swift
Last update
5 months ago
Type
Library

What it is

PromiseKit is a library that helps Swift and Objective-C developers handle asynchronous work, such as network requests or location lookups, in a readable chain of steps instead of nested callbacks. It includes extensions that wrap many of Apple's own asynchronous APIs as promises, and it is installed as a CocoaPod, with Carthage and SwiftPM also mentioned in the README.

  • Fetch an image and a location in parallel, then update the UI when both finish
  • Make a URLSession request, validate the HTTP status, and decode JSON in a chain
  • Wrap Apple framework calls such as MKDirections or CLLocationManager in promise chains using optional subspecs

Great for

  • iOS or macOS developers who chain several asynchronous operations
  • Teams maintaining an Objective-C codebase that needs promise-style APIs
  • Developers who want Apple framework calls such as URLSession or CoreLocation wrapped as promises
  • Projects that still use CocoaPods, Carthage, or SwiftPM and need to support older Xcode versions

Not ideal for

  • Developers writing new code on Swift 5.5+ who want built-in async/await; the README points to a separate port called Async+ for that style
  • Beginners with no Swift or Apple platform experience, since the README assumes familiarity with Xcode and dependency managers
  • Projects that need only a single callback and gain little from a promise abstraction
Step-by-step guide: how to use PromiseKitInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Xcode 13 or newer (per the README for PromiseKit 8) · CocoaPods, Carthage, or Swift Package Manager

    Add to your Podfile

    pod "PromiseKit", "~> 8"
  2. 2

    Run it

    • Add the pod to your Podfile inside your app target and run pod install
    • Import PromiseKit in a Swift file
    • Wrap an asynchronous call in a promise or use an existing extension such as URLSession's dataTask(.promise)
    • Chain steps with then, map, done, and catch to handle results and errors
  3. 3

    Get the most out of it

    • Add optional subspecs such as PromiseKit/MapKit or PromiseKit/CoreLocation for Apple framework extensions
    • Use the Objective-C Guide in the documentation if you work in Objective-C
    • Read the Common Patterns handbook page for typical chains
    • Use the Troubleshooting guide for common compile errors

Downloads

Strengths

  • The README describes the Objective-C bridging and Apple platform extensions as a core strength
  • Extensions are available as separate optional subspecs, so you only add what you use
  • Licensed under MIT, which permits commercial use

Trade-offs

  • The README recommends Async+ for Swift 5.5+ async/await patterns, which suggests the core project is not the main path for new code
  • Version support notes in the README refer to older Xcode and Swift versions, so compatibility should be checked against your own toolchain
  • The README is truncated in places and does not give a full feature list

How it compares

ProjectStarsTypeLevelUpdatedBest for
PromiseKit (this)14.2kLibraryintermediate5 months agoiOS or macOS developers who chain several asynchronous operations
SDWebImage25.6kLibraryintermediate7 months agoiOS or macOS app developers who need to show remote images in lists or grids
RxSwift24.6kLibraryintermediate2 months agoSwift developers building iOS, macOS, tvOS, or watchOS apps who already handle many asynchronous events
Kingfisher24.4kLibrarybeginner4 days agoiOS or macOS developers who need to show remote images in lists or detail screens
ReactiveCocoa19.8kLibraryintermediate1.2 years agoiOS or macOS developers already using ReactiveSwift
IQKeyboardManager16.6kLibrarybeginner1 months agoiOS app developers building forms or screens with several text inputs

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.