Giter VIP home page Giter VIP logo

promisekit's Introduction

PromiseKit

Modern development is highly asynchronous: isn’t it about time we had tools that made programming asynchronously powerful, easy and delightful?

UIApplication.sharedApplication().networkActivityIndicatorVisible = true

when(fetchImage(), getLocation()).then { image, location in
    self.imageView.image = image;
    self.label.text = "Buy your cat a house in \(location)"
}.finally {
    UIApplication.sharedApplication().networkActivityIndicatorVisible = false
}.catch { error in
    UIAlertView().show()
}

PromiseKit is a thoughtful and complete implementation of promises for iOS and OS X with first-class support for both Objective-C and Swift.

Join the chat at https://gitter.im/mxcl/PromiseKit Carthage compatible

Swift 2

The swift-2.0-beta branch has a working Swift 2 implementation. Please be aware that both catch and defer are Swift 2 keywords so we have had to rename these functions and our new choices are not yet final.

PromiseKit 2

PromiseKit 2 contains many interesting and important additions. Check out our our release announcement for full details.

How To Get Started

  • Check out the complete, comprehensive PromiseKit documentation.
  • Read the API documentation, (note the documentation is not 100% currently as CocoaDocs is not good with Swift, you may have better luck reading the comments in the sources).
  • Integrate promises into your existing projects.

Quick Start Guide

CocoaPods

use_frameworks!

pod "PromiseKit", "~> 2.0"

Carthage

github "mxcl/PromiseKit" ~> 2.0

Note: In order to avoid linking nearly all system frameworks with PromiseKit, the convenience categories have not been included with the Carthage framework . You must manually copy the categories you need in from the Carthage checkout.

Standalone Distributions

Please note, the preferred way to integrate PromiseKit is CocoaPods or Carthage.

iOS 7 And Below

Neither CocoaPods or Carthage will install PromiseKit 2 for an iOS 7 target. Your options are:

  1. pod "PromiseKit", "~> 1.5" †‡
  2. Use our iOS 7 EZ-Bake
  3. Download our pre-built static framework (coming soon!)

† There is no Swift support with PromiseKit 1.x installed via CocoaPods.
‡ PromiseKit 1.x will work as far back as iOS 5 if required.

Donations

PromiseKit is hundreds of hours of work almost completely by just me: Max Howell. I thoroughly enjoyed making PromiseKit, but nevertheless if you have found it useful then your bitcoin will give me a warm fuzzy feeling from my head right down to my toes: 1JDbV5zuym3jFw4kBCc5Z758maUD8e4dKR.

License

Copyright 2015, Max Howell; [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

promisekit's People

Contributors

mxcl avatar nathanhosselton avatar tgaul avatar josejulio avatar codecaffeine avatar abizern avatar pgherveou avatar tikitu avatar bruzenak avatar dbachrach avatar allen-zeng avatar nhatn avatar oztune avatar hariseldon78 avatar robinwit avatar sdolidze avatar slavikus avatar stevenp avatar tp avatar weiran avatar eldereal avatar mackross avatar maximusmccann avatar pocketpixels avatar maml avatar mattbmorton avatar l4u avatar jessedc avatar vloothuis avatar jallen avatar

Watchers

Anil Ardahanli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.