Kommander 0.7.0

Kommander 0.7.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by alexruperez.


Downloads

Total1,226
Week87
Month186

Installs

Apps23
Apps WeekApps This Week 10
Test Targets14
Test WeekTests This week 4
powered by Segment

GitHub

Stars81
Watchers7
Forks4
Issues0
Contributors4
Pull Requests0

Code

Files6
LOCLines of Code 321


Kommander 0.7.0

  • By
  • Alex Rupérez, Juan Trías and Roberto Estrada

Kommander

Kommander is a Swift library to manage the task execution in different threads. Through the definition a simple but powerful concept, Kommand.

Inspired on the Java library Kommander from Wokdsem.

Kommander

Features

  • [x] Make kommand or multiple kommands
  • [x] Execute kommand or multiple kommands
  • [x] Cancel kommand or multiple kommands
  • [x] Set kommand success block
  • [x] Set kommand error block
  • [x] Main thread dispatcher
  • [x] Current thread dispatcher
  • [x] Custom OperationQueue dispatcher
  • [x] Custom DispatchQueue dispatcher
  • [x] Execute single or multiple Operation
  • [x] Execute sequential or concurrent blocks
  • [x] Execute DispatchWorkItem
  • [x] Kommand state
  • [x] watchOS compatible
  • [x] tvOS compatible
  • [x] Swift 2 version
  • [x] Objective-C version

Installation

Kommander is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Kommander'

For Swift 2 compatibility use:

pod 'Kommander', :git => 'https://github.com/intelygenz/Kommander-iOS.git', :tag => '0.3.0-swift2'

For Objective-C compatibility use:

pod 'Kommander', :git => 'https://github.com/intelygenz/Kommander-iOS.git', :tag => '0.2.3-objc'

Or install it with Swift Package Manager:

dependencies: [
    .Package(url: "https://github.com/intelygenz/Kommander-iOS.git")
]

Usage

Kommander().makeKommand {
    // Your code here
}.execute()
Kommander().makeKommand { () -> String in
    return "Your string"
}.onSuccess { yourString in
    print(yourString)
}.execute()
Kommander().makeKommand {
    throw CocoaError(.featureUnsupported)
}.onError({ error in
    print(String(describing: error!))
}).execute()
let kommand = Kommander().makeKommand { () -> Any? in
    // Your code here
}.onSuccess { result in
    // Your success handling here
}.onError({ error in
    // Your error handling here
}).execute()

kommand.cancel()

Etc.

  • Contributions are very welcome.
  • Attribution is appreciated (let’s spread the word!), but not mandatory.

Authors

alexruperez, [email protected]

juantrias, [email protected]

RobertoEstrada, [email protected]

License

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