Promise / Future concept for Swift developing.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Oath
Sample
.gitignore
.swift-version
LICENSE.md
Oath.podspec
Package.swift
README.md
_config.yml

README.md


Version Author Build Passing Swift
Platforms MIT
Cocoapods Carthage SPM

🏵 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 4.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") }
    }
}