🏵 Introduction
Oath is a Promise / Future concept implementation for Swift developing.
Learn more about Promise.
📋 Requirements
- iOS 8.0+
- macOS 10.10+
- tvOS 9.0+
- Xcode 9.0+ with Swift 5.0+
📲 Installation
Oath is available on CocoaPods:
use_frameworks!
pod 'Oath'❤️ Contribution
You are welcome to fork and submit pull requests.
🔖 License
Oath is open-sourced software, licensed under the MIT license.
💫 Usage
fetchUserInfo().then { info in
print("User: \(info)")
}.onError { e in
print("An error occured : \(e)")
}.finally {
print("Everything is done <3")
}func fetchUserInfo() -> Promise<String> {
return Promise { resolve, reject in
print("fetching user info...")
wait { resolve("Elias") }
}
}