Latest 0.1.2
Homepage https://github.com/sethsamuel/MMX-PromiseKit
License MIT
Platforms ios 8.0
Dependencies MMX, PromiseKit
Authors

Build Status
Coverage Status

Installation

Include the PromiseKit category with #import "MMX+PromiseKit.h".

Usage

Most methods are a straightforward conversion from callbacks to promises. For example, to find channels with tag foo:

  [MMXChannel findByTags:[NSSet setWithArray:@[@"foo"]]]
  .then(^(NSNumber *count, NSArray* channels){
  });

For message methods that return a messageID before executing the callback, a promise is returned with the messageID as the first argument, and the completion promise as the second:

  MMXMessage *messsage = [MMXMessage messageToChannel:someChannel messageContent:someContent];
  [message send]
  .then(^(NSString *messageID, PMKPromise *complete){
    //Do something with messageID
    return complete;
  })
  .then(^(){
    //Message is now sent
  });

Latest podspec

{
    "name": "MMX-PromiseKit",
    "version": "0.1.2",
    "summary": "PromiseKit category for Magnet Messaging (MMX).",
    "description": "PromiseKit wrappers for Magnet Messaging (MMX) library. All asynchronous methods have been updated to return promises. Includes both Objective-C and Swift methods.",
    "homepage": "https://github.com/sethsamuel/MMX-PromiseKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Seth Samuel": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/sethsamuel/MMX-PromiseKit.git",
        "tag": "0.1.2"
    },
    "source_files": "MMX-PromiseKit/**/*.{m,h,swift}",
    "xcconfig": {
        "HEADER_SEARCH_PATHS": "$(SDKROOT)/usr/include/libxml2"
    },
    "dependencies": {
        "MMX": [
            "~> 1.6"
        ],
        "PromiseKit": [
            "~> 2"
        ]
    }
}

Pin It on Pinterest

Share This