RxEureka
This library is a small Rx wrapper around Eureka
Table of contents:
- Observing row value changes
- Binding row value changes to variables
- Example app
- Requirements
- Installation
- Author
- License
- References
Observing row value changes
RxEureka can be used to create Observable
s from the value property of Eureka
's rows :
let row = TextRow() { row in
row.title = "Text Row"
row.placeholder = "Enter text here"
}
let disposeBag = DisposeBag()
row.rx.value
.asObservable()
.subscribe(onNext: { value in
print("Row value did change to \(value)")
})
.disposed(by: disposeBag)
Binding row value changes to variables
With RxEureka you can also bind the Eureka
's rows values to your variables :
let row = TextRow() { row in
row.title = "Text Row"
row.placeholder = "Enter text here"
}
let myVariable: Variable<String?> = Variable(nil)
let disposeBag = DisposeBag()
row.rx.value
.asObservable()
.bind(to: myVariable)
.disposed(by: disposeBag)
Example app
To run the example project, clone the repo, and run pod install
from the Example directory first.
The app usesRxSwift
, RxCocoa
to observe values from Eureka
.
Requirements
- Xcode 9.x
- Swift 4.0
Installation
Cocoapods
RxEureka is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RxEureka", "~> 0.2"
Tested with version Cocoapods 1.2.0
Carthage
RxEureka is available through Carthage. To install it, simply add the following line to your Cartfile:
github "antoninbiret/RxEureka" ~> 0.2
Please make sure you also embed the framework dependencies into your Xcode project:
Eureka.framework
, RxSwift.framework
, RxCocoa.framework
.
For details see the Carthage: Getting Started.
Tested with version Carthage 0.28.0
Author
Antonin Biret
License
RxEureka is available under the MIT license. See the LICENSE file for more info.