RxSwift/RxCocoa/iOS/UISlider+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
643 B
Swift

//
// UISlider+Rx.swift
// RxCocoa
//
// Created by Alexander van der Werff on 28/05/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: UISlider {
/**
Reactive wrapper for `value` property.
*/
public var value: ControlProperty<Float> {
return Reactive<UIControl>.value(
self.base,
getter: { slider in
slider.value
}, setter: { slider, value in
slider.value = value
}
)
}
}
#endif