Code Monkey home page Code Monkey logo

promisekit's Introduction

PromiseKit

badge-languages badge-platforms


Promises simplify asynchronous programming, freeing you up to focus on the more important things. They are easy to learn, easy to master and result in clearer, more readable code. Your co-workers will thank you.

UIApplication.shared.isNetworkActivityIndicatorVisible = true

let fetchImage = URLSession.shared.dataTask(.promise, with: url).compactMap{ UIImage(data: $0.data) }
let fetchLocation = CLLocationManager.requestLocation().lastValue

firstly {
    when(fulfilled: fetchImage, fetchLocation)
}.done { image, location in
    self.imageView.image = image
    self.label.text = "\(location)"
}.ensure {
    UIApplication.shared.isNetworkActivityIndicatorVisible = false
}.catch { error in
    self.show(UIAlertController(for: error), sender: self)
}

PromiseKit is a thoughtful and complete implementation of promises for any platform that has a swiftc. It has delightful specializations for iOS, macOS, tvOS and watchOS. It is a top-100 pod used in many of the most popular apps in the world.

codecov

Requirements

Xcode >= 12.0 or Swift >= 5.3.

For earlier Swifts, Xcodes or for Objective-C support, use PromiseKit 6.

Quick Start

In your Package.swift:

package.dependencies.append(
    .package(url: "https://github.com/mxcl/PromiseKit", from: "7.0.0-rc1")
)

For more detailed installation instructions or for other package managers see our Installation Guide.

Professionally Supported PromiseKit is Now Available

TideLift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.

Get Professional Support for PromiseKit with TideLift.

Other Sponsorship

Maintaining this project is work, if your company uses this project please sponsor it either via Tidelift or GitHub Sponsors.

Documentation

Extensions

Promises are only as useful as the asynchronous tasks they represent. Thus, we have converted (almost) all of Apple’s APIs to promises. You can use the extensions by adding the appropriate library to your Package.swift and then importing it (eg. import PMKFoundation).

See our Installation Guide for usage details.

Browse the Sources folder here for a list of available extensions.

Support

Please check our Troubleshooting Guide, and if after that you still have a question, ask at our Gitter chat channel or on our bug tracker.

Security & Vulnerability Reporting or Disclosure

https://tidelift.com/security

promisekit's People

Contributors

abizern avatar allen-zeng avatar cecuba avatar codecaffeine avatar dougzilla32 avatar drekka avatar dtaylor1701 avatar feighter09 avatar filipzawada avatar garthsnyder avatar iammxrn avatar javilorbada avatar jeehut avatar josejulio avatar kdubb avatar lammertw avatar ldiqual avatar linusu avatar lutzifer avatar mxcl avatar nathanhosselton avatar nathanli avatar neallester avatar pgherveou avatar romanpodymov avatar ryanschneider avatar shergin avatar tgaul avatar tikitu avatar zlangley avatar

Watchers

 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.