title: Splitting an RACSignal to eliminate state
body: <p>I'm using ReactiveCocoa to update a <code>UILabel</code> whilst a <code>UIProgressView</code> counts down:</p>
  
  <pre><code>NSInteger percentRemaining = ...;
  self.progressView.progress = percentRemaining / 100.0;
  
  __block NSInteger count = [self.count];
  
  [[[RACSignal interval:0.05 onScheduler:[RACScheduler mainThreadScheduler]]
      take: percentRemaining]
      subscribeNext:^(id x) {
          count++;
          self.countLabel.text = [NSString stringWithFormat:@"%d", count];
          self.progressView.progress = self.progressView.progress - 0.01;
      } completed:^{
          // Move along...
      }];
  </code></pre>
  
  <p>This works well enough but, I'm not particularly happy with either the <code>count</code> variable or with reading the value of <code>self.progressView.progress</code> in order to decrement it. </p>
  
  <p>I feel like I should be able to spit the signal and bind the properties directly using the <code>RAC</code> macro. Something like: </p>
  
  <pre><code>RACSignal *baseSignal = [[RACSignal interval:0.05 onScheduler:[RACScheduler mainThreadScheduler]]
                              take: percentRemaining]
  
  RAC(self, countLabel.text) = [baseSignal
                                    map: ...
                                    ...
  
  RAC(self, progressView.progress) = [baseSignal
                                          map: ...
                                          ...
  </code></pre>
  
  <p>The <code>...</code>s reveal where I'm stuck. I can't quite get my head around how to compose the <code>RACSignal</code> such that I don't need to rely on a state variable. </p>
  
  <p>Additionally I'm not sure where/how to inject the <code>// Move along...</code> side effect I need when the stream completes. </p>
  
  <p>I'm sure both are simple enough once you're thinking the right way but, any help would be really appreciated.</p>