title: RxSwift: using rx_refreshing for uirefreshcontrol
body: <p>I am using the <code>UIRefreshControl</code> + <code>Variable</code> binding to reload data.</p>
  
  <p>It is working, however, the following feels wrong to me:</p>
  
  <p>1) I know there is a <code>rx_refreshing</code> variable in the <code>RXCocoa</code> extension, but I am unable to get it to work in this context.</p>
  
  <p>2) I am binding answers (which is a <code>Variable</code> of array) twice. Once when I load the view controller and again when the <code>UIRefreshControl</code> is refreshing.</p>
  
  <p>3) The parts where I check for whether the <code>UIRefreshControl</code> is refreshing or not looks really awkward. It feels like it defeats the purpose of using reactive?</p>
  
  <pre><code>...
  
  let answers: Variable&lt;[Answer]&gt; = Variable([])
  
  override func viewDidLoad() {       
    loadAnswers()
       .shareReplay(1)
       .bindTo(answers)
       .addDisposableTo(self.disposeBag)
    setupRx()
  }
  
  func loadAnswers() -&gt; Observable&lt;[Answer]&gt; {
    return Network.rxArrayRequest(Spark.Answers)
  }  
  
  func setupRx() {
    rc.rx_controlEvent(.ValueChanged)
      .map { _ in !self.rc.refreshing }
      .filter { $0 == false }
      .flatMapLatest { [unowned self] _ in
        return self.loadAnswers()
      }
      .bindTo(answers)
      .addDisposableTo(self.disposeBag)
  
    rc.rx_controlEvent(.ValueChanged)
      .map { _ in self.rc.refreshing }
      .filter { $0 == true }
      .subscribeNext { [unowned self] _ in
        self.rc.endRefreshing()
      }
      .addDisposableTo(self.disposeBag)
  }
  
  ...
  </code></pre>