PromiseKit extension for WatchKit
Swift Ruby
Switch branches/tags
Latest commit 1cd7ce8 Jul 17, 2017 @sforteln Release 0.2.2
Permalink
Failed to load latest commit information.
Source Release 0.2.2 Jul 17, 2017
LICENSE Inital Commit Jul 5, 2017
README.md Update podspec Jul 16, 2017
WatchKitPromises.podspec Release 0.2.2 Jul 17, 2017

README.md

WatchKitPromises

PromiseKit support for WatchKit

Installation

WatchKitPromises is available through CocoaPods. To install it, simply add the following line to your Podfile in the WatchKit Extension target:

target 'XXXX WatchKit Extension' do

  pod 'WatchKitPromises'

end

Usage

import WatchKitPromises

override func awake(withContext context: Any?) {
    super.awake(withContext: context)

    self.animate(duration: duration, animations: {
        self.startButton?.setAlpha(0)
        self.swipeLabel?.setAlpha(0)
    })
    .wait(2)
    .then(execute: {
        ///API request, etc
        return
    })
    .animate(in: self, duration: 2, animations: {
        self.startButton?.setAlpha(1)
        self.swipeLabel?.setAlpha(1)

    })
}

Author

Simon Fortelny, sforteln@gmail.com

License

WatchKitPromises is available under the MIT license. See the LICENSE file for more info.