A lightweight Swift library for writing concise and maintainable asynchronous code using promises and async/await.
Then is a Swift library that provides a Promise/Future implementation for handling asynchronous operations. It solves the problem of callback hell by allowing developers to chain async tasks with a clean, readable syntax and includes async/await support for writing synchronous-style async code.
Swift developers building iOS, macOS, tvOS, or watchOS applications who need to manage asynchronous tasks like network requests, file I/O, or complex async workflows in a maintainable way.
Developers choose Then for its concise API that makes async code easy to read and maintain, its rich set of utilities for advanced async patterns, and its lightweight, pure-Swift design that integrates seamlessly with Apple's platforms.
:clapper: Tame async code with battle-tested promises
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The then/onError/finally methods enable chaining async operations into concise, sequential-like code, dramatically reducing callback hell as shown in the before-and-after examples.
Includes advanced helpers like race, recover, validate, retry, and whenAll for handling complex async workflows, providing flexibility beyond basic Promise patterns.
Offers awaitPromise and async helpers for writing synchronous-style async code, bridging gaps in projects not yet on Swift's native concurrency.
Built entirely in Swift with minimal dependencies and optimized for all Apple platforms, making integration straightforward via Swift Package Manager.
Cocoapods and Carthage installations are deprecated as of version 5.1.3, forcing users to adopt Swift Package Manager or risk future incompatibility.
With Swift 5.5+ introducing native async/await, this library's async/await features may add unnecessary overhead for new projects targeting modern Swift versions.
The library has multiple version bumps tied to Swift updates (e.g., Swift 2 to 5.1), requiring migration efforts and introducing potential instability.