title: Custom UISlider with RxSwift support
body: <p>I have created a custom control thad works as <code>UISlider</code>. Now I want to use it with RxSwift and for this I need <code>rx_value</code> like property for my control. 
  I have found RxSwift code for <code>UISlider</code> on GitHub: </p>
  
  <pre><code>extension UISlider {
  
      /**
      Reactive wrapper for `value` property.
      */
      public var rx_value: ControlProperty&lt;Float&gt; {
          return UIControl.rx_value(
              self,
              getter: { slider in
                  slider.value
              }, setter: { slider, value in
                  slider.value = value
              }
          )
      }
  
  }
  </code></pre>
  
  <p>It does look simple enough so I decided just to repeat it in my control but apparently <code>rx_value</code> property of <code>UIControl</code> is private. What could be a workaround for this? </p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>That is how I'm going to use this property:</p>
  
  <pre><code>var latestRank: Observable&lt;Int&gt; {
          return oneSlider
              .rx_distance.asObservable()
              .throttle(0.5, scheduler: MainScheduler.instance)
              .distinctUntilChanged()
  </code></pre>
  
  <p>and in viewModel:</p>
  
  <pre><code>distanceRank
              .observeOn(MainScheduler.instance).subscribeNext { rank in
                  print(rank)
                  self.discoverNodes(true)
          }
  </code></pre>
  
  <p>In viewModel <code>distanceRank</code> is defined as this:</p>
  
  <pre><code>let distanceRank: Observable&lt;Int&gt;
  </code></pre>
  
  <p>And this is extension for <code>rx_distance</code>: </p>
  
  <pre><code>#if os(iOS) || os(tvOS)
  import Foundation
  #if !RX_NO_MODULE
      import RxSwift
      import RxCocoa
  #endif
  import UIKit
  
  extension OneSlider {
  
      public var rx_distance: ControlProperty&lt;Int&gt; {
          return UIControl.valuePublic(
              self,
              getter: { slider in
                  slider.distanceRank
              }, setter: { slider, value in
                  slider.distanceRank = value
              }
          )
      }
  
  }
  
  extension UIControl {
      static func valuePublic&lt;T, ControlType: UIControl&gt;(control: ControlType, getter:  ControlType -&gt; T, setter: (ControlType, T) -&gt; ()) -&gt; ControlProperty&lt;T&gt; {
          let values: Observable&lt;T&gt; = Observable.deferred { [weak control] in
              guard let existingSelf = control else {
                  return Observable.empty()
              }
  
              return existingSelf.rx_controlEvent([.AllEditingEvents, .ValueChanged])
                  .flatMap { _ in
                      return control.map { Observable.just(getter($0)) } ?? Observable.empty()
                  }
                  .startWith(getter(existingSelf))
          }
          return ControlProperty(values: values, valueSink: UIBindingObserver(UIElement: control) { control, value in
              setter(control, value)
              })
      }
  }
  
  #endif
  </code></pre>