A Swift implementation of futures/promises for iOS, macOS, watchOS, and tvOS to simplify asynchronous programming.
Bolts-Swift is a Swift library that implements the futures/promises pattern for Apple platforms (iOS, macOS, watchOS, tvOS). It simplifies asynchronous programming by allowing developers to chain operations, handle errors gracefully, and execute tasks in parallel without callback pyramids. Originally created by Parse and Facebook for internal use, it solves common challenges in mobile app development related to concurrency and code organization.
iOS and macOS developers building applications that require complex asynchronous operations, such as network requests, database interactions, or multi-step workflows. It's particularly useful for teams looking to avoid callback hell and write more maintainable asynchronous code.
Developers choose Bolts-Swift because it provides a lightweight, platform-native implementation of futures/promises with full support for chaining, cancellation, and custom executors. Unlike some alternatives, it's designed specifically for Swift and Apple's ecosystem, offering seamless integration with existing concurrency models while keeping resource usage low.
Bolts is a collection of low-level libraries designed to make developing mobile apps easier.
Provides methods like `continueWith` and `continueOnSuccessWithTask` to chain asynchronous operations sequentially, eliminating callback pyramids and improving code readability as shown in the README examples.
Supports custom executors to control where continuation closures run, such as on the main thread, allowing seamless integration with various threading models without locking into a specific one.
Tasks do not occupy threads while waiting, consuming fewer system resources compared to traditional threading approaches, which is highlighted as a key benefit in the README.
Enables running multiple tasks concurrently and synchronizing results with `whenAll()`, simplifying complex workflows like batch operations demonstrated in the code snippets.
The README warns that including Bolts as a subproject significantly increases indexing time in Xcode, which can hinder development speed and workflow efficiency.
Does not natively support Swift's newer concurrency features like async/await, requiring manual bridging and making it less appealing for projects adopting up-to-date Swift practices.
Full method lists are only available in source code (e.g., Task+ContinueWith.swift), which can complicate learning and debugging for developers needing detailed guidance.
Promises for Swift & ObjC.
Bolts is a collection of low-level libraries designed to make developing mobile apps easier.
Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
⚡️ Lightweight full-featured Promises, Async & Await Library in Swift
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.