Latest 0.2
Homepage https://github.com/livio/SmartDeviceLink-PromiseKit
License New BSD
Platforms ios 8.0, requires ARC
Dependencies PromiseKit, SmartDeviceLink-iOS

This project adds promises to SmartDeviceLink iOS.

Usage

let file = SDLFile(data: Data(), name: "Temp", fileExtension: "bmp")
sdlManager.fileManager.upload(file: file).then { bytesAvailable in
    print("(bytesAvailable) bytes remaining on remote system")
    // Do something if you'd like
}.then(execute: { () -> Promise<(SDLRPCRequest, SDLRPCResponse)> in
    // The upload succeeded if we got here
    let image = SDLImage(name: "Temp", of: .dynamic())
    let show = SDLShow(mainField1: "Update", mainField2: "Show", mainField3: nil, mainField4: nil, alignment: .centered(), statusBar: nil, mediaClock: nil, mediaTrack: nil, graphic: image, softButtons: nil, customPresets: nil)!
    return sdlManager.send(request: show)
}).then { request, response -> Void in
    // We are guaranteed it succeeded if we get here
    print("The show request: (request)")
    print("The show's successful response: (response)")
}.catch { error in
    // Something went wrong at some point if we got here
    print("The upload or show errored: (error)")
}

Cocoapods

pod 'SmartDeviceLink+PromiseKit', '~> 0.1'

Carthage

github "Livio/SmartDeviceLink+PromiseKit" ~> 0.1

Latest podspec

{
    "name": "SmartDeviceLink+PromiseKit",
    "version": "0.2",
    "platforms": {
        "ios": "8.0"
    },
    "license": {
        "type": "New BSD",
        "file": "LICENSE"
    },
    "summary": "PromiseKit extensions for SmartDeviceLink",
    "authors": "Joel Fischer",
    "homepage": "https://github.com/livio/SmartDeviceLink-PromiseKit",
    "source": {
        "git": "https://github.com/livio/SmartDeviceLink-PromiseKit.git",
        "tag": "0.2"
    },
    "source_files": "SmartDeviceLink-PromiseKit/*",
    "requires_arc": true,
    "dependencies": {
        "PromiseKit": [
            "~> 4.0"
        ],
        "SmartDeviceLink-iOS": [
            "~> 4.3"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This