Skip to content

Commit 9c98fde

Browse files
committed
Modernizes the API and improves unit test.
1 parent 0811292 commit 9c98fde

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

RxCocoa/iOS/UIStepper+Rx.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ extension Reactive where Base: UIStepper {
2727
}
2828

2929
/// Reactive wrapper for `stepValue` property.
30-
public var stepValue: UIBindingObserver<Base, Double> {
31-
return UIBindingObserver(UIElement: self.base) { stepper, value in
30+
public var stepValue: Binder<Double> {
31+
return Binder(self.base) { stepper, value in
3232
stepper.stepValue = value
3333
}
3434
}

Tests/RxCocoaTests/UIStepper+RxTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ import XCTest
2626
func testStepper_stepValueObserver() {
2727
let stepper = UIStepper()
2828
let stepValue: Double = 0.42
29+
30+
stepper.stepValue = 1.0
31+
XCTAssertEqualWithAccuracy(stepper.stepValue, 1.0, accuracy: 0.0001)
32+
2933
Observable.just(stepValue).bind(to: stepper.rx.stepValue).dispose()
3034
XCTAssertEqualWithAccuracy(stepper.stepValue, stepValue, accuracy: 0.0001)
3135
}

0 commit comments

Comments
 (0)