mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
10ff55cfba
The main work is done in this commit but the feature it's still "work in progress"
36 lines
643 B
Swift
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
|