ALReactiveCocoaExtension 4.1.1

ALReactiveCocoaExtension 4.1.1

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

Maintained by Antoine v.d. Lee.



 
Depends on:
Moya~> 8.0.0
ReactiveSwift>= 0
 

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

The pod includes extensions for SignalProducer.

SignalProducer extension

This pod includes an extension for the new SignalProducer. This brings the methods we're familiar with from earlier versions of ReactiveCocoa.

let producer = SignalProducer<String, NSError>(value: "testValue")

// Prints "producer started!"
producer.onStarting { () -> () in
    print("producer started!")
}.start()

// Prints "testValue"
producer.onNext { (object) -> () in
    print(object)
}.start()

// Prints "testValue", can be used to cast AnyObjects for example
producer.onNextAs { (string:String) -> () in
    print(string)
}.start()

// Prints "testValue", can be used to cast AnyObjects for example
producer.startWithNextAs { (string:String) -> () in
    print(string)
}

// Prints "Error Domain=sample.domain Code=-1 "(null)""
let errorProducer = SignalProducer<String, NSError>(error:NSError(domain: "sample.domain", code: -1, userInfo: nil))
errorProducer.onError { (error) -> () in
    print(error)
}.start()

Requirements

  • This pod requires ReactiveCocoa 5.0.0 and up
  • Swift 3.0
  • iOS 8+
  • tvOS 9+
  • watchOS 2+

Installation

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

pod "ALReactiveCocoaExtension"

Swift version vs Pod version

Swift version Pod version
3.X >= 4.0.0
2.3 3.0.3

Author

Antoine van der Lee, https://twitter.com/twannl https://www.avanderlee.com

License

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