Installation
Then is a Swift library compatible with iOS 12+, macOS 10.13+, tvOS 12+, and watchOS 6+.
The recommended and officially supported way to install Then is using the Swift Package Manager (SPM).
Swift Package Manager (SPM)
SPM is Apple's official dependency manager integrated directly into Xcode. To add Then to your project:
- In Xcode, open your project and navigate to File > Swift Packages > Add Package Dependency...
- In the package repository URL field, enter:
https://github.com/freshOS/Then - Choose the version rules and click Next.
- Select the
Thenlibrary to be added to your app's target. - Click Finish.
Your Package.swift manifest might look like this:
// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "MyApp",
dependencies: [
.package(url: "https://github.com/freshOS/Then.git", from: "5.1.3")
],
targets: [
.target(
name: "MyApp",
dependencies: ["Then"])
]
)
Deprecated Methods
As of version 5.1.3, Cocoapods and Carthage are deprecated and will not be supported in future versions. It is highly recommended to migrate to Swift Package Manager.
Cocoapods
target 'MyApp'
pod 'thenPromise'
use_frameworks!
Carthage
github "freshOS/then"
Swift Version Compatibility
Then maintains compatibility with various Swift versions. Refer to the table below for the correct library version for your toolchain:
| Swift Version | Then Version |
|---|---|
| Swift 2 | 1.4.2 |
| Swift 3 | 2.2.5 |
| Swift 4 | 3.1.0 |
| Swift 4.1 | 4.1.1 |
| Swift 4.2 | 4.2.0 |
| Swift 4.2.1 | 4.2.1 |
| Swift 5.0 | 5.0.0 |
| Swift 5.1+ | 5.1.0+ |