Files
RxSwift/RxCocoa/iOS/UIDatePicker+Rx.swift
Jérôme Alves 10ff55cfba Moves RxCocoa extensions from rx_ syntax to rx. syntax.
The main work is done in this commit but the feature it's still "work in progress"
2016-08-09 00:17:38 +02:00

36 lines
654 B
Swift

//
// UIDatePicker+Rx.swift
// RxCocoa
//
// Created by Daniel Tartaglia on 5/31/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if os(iOS)
import Foundation
#if !RX_NO_MODULE
import RxSwift
#endif
import UIKit
extension Reactive where Base: UIDatePicker {
/**
Reactive wrapper for `date` property.
*/
public var date: ControlProperty<Date> {
return Reactive<UIControl>.value(
self.base,
getter: { datePicker in
datePicker.date
}, setter: { datePicker, value in
datePicker.date = value
}
)
}
}
#endif