Latest 0.1.0
Homepage https://github.com/rolandoasmat/SwiftPromise
License MIT
Platforms ios 9.0
Authors

Build Status

Use this library to create a thenable Promise.

Usage

Create the promise

// Init
let promise = Promise<Double>() { fulfill, reject in
    let result = 44.0
    // Fulfill the promise
    fulfill(result)
}

Respond to error or result

promise.then({ (result) in
    print("Got the result!n(result)")
    expect.fulfill()
}) { (error) in
        print("Got an  error :(n(error.localizedDescription)")
    }

Installation

CocoaPods

Include SwiftPromise in your Podfile

platform :ios, '9.0'
use_frameworks!

target 'SampleApp' do
  pod 'SwiftPromise'
end

Then, install

$ pod install

Carthage

Coming soon!

Latest podspec

{
    "name": "SwiftPromise",
    "version": "0.1.0",
    "summary": "A minimal Promise library.",
    "description": "Use this library to create a thenable Promise.",
    "homepage": "https://github.com/rolandoasmat/SwiftPromise",
    "license": "MIT",
    "authors": {
        "Rolando Asmat": "[email protected]"
    },
    "social_media_url": "https://twitter.com/Rolando_Asmat",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/rolandoasmat/SwiftPromise.git",
        "tag": "0.1.0"
    },
    "source_files": "SwiftPromise/SwiftPromise",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This