add countDownDuration for UIDatePicker

This commit is contained in:
pawurb 2017-02-13 15:47:56 +01:00 committed by Krunoslav Zaher
parent 4e19a21bda
commit 5549587648

View File

@ -18,7 +18,7 @@ extension Reactive where Base: UIDatePicker {
public var date: ControlProperty<Date> {
return value
}
/// Reactive wrapper for `date` property.
public var value: ControlProperty<Date> {
return UIControl.rx.value(
@ -30,7 +30,18 @@ extension Reactive where Base: UIDatePicker {
}
)
}
/// Reactive wrapper for `countDownDuration` property.
public var countDownDuration: ControlProperty<TimeInterval> {
return UIControl.rx.value(
self.base,
getter: { datePicker in
datePicker.countDownDuration
}, setter: { datePicker, value in
datePicker.countDownDuration = value
}
)
}
}
#endif