title: Defer RACSignal until UIScrollView is not dragging, tracking or decelerating
body: <p>Is this OK? </p>
  
  <pre><code>- (RACSignal *)deferRefreshSignalUntilScrollViewIsNotBusy:(RACSignal *)infiniteSignal
  {
      return [RACSignal createSignal:^RACDisposable *(id&lt;RACSubscriber&gt; subscriber) {
          __block BOOL disposed = NO;
          RACDisposable *disposable = [infiniteSignal subscribeNext:^(id originalValue) {
              dispatch_repeated(0.0, 0.5, dispatch_get_main_queue(), ^(BOOL *stop) {
  
                  BOOL scrollViewIsBusy = self.scrollView.isTracking
                     || self.scrollView.isDecelerating
                     || self.scrollView.isDragging
                     || _flags.animatingArticlePageScroller;
  
                  *stop = disposed;
  
                  if(!scrollViewIsBusy)
                  {
                      [subscriber sendNext:originalValue];
                      *stop = YES;
                  }
              });
          }];
          return [RACDisposable disposableWithBlock:^{
              [disposable dispose];
              disposed = YES;
          }];
      }];
  }
  
  static void dispatch_repeated_internal(dispatch_time_t firstPopTime, double intervalInSeconds, dispatch_queue_t queue, void(^work)(BOOL *stop))
  {    
      __block BOOL shouldStop = NO;
      dispatch_time_t nextPopTime = dispatch_time(firstPopTime, (int64_t)intervalInSeconds * NSEC_PER_SEC);
      dispatch_after(nextPopTime, queue, ^{
          work(&amp;shouldStop);
          if(!shouldStop)
          {
              dispatch_repeated_internal(nextPopTime, intervalInSeconds, queue, work);
          }
      });
  }
  
  void dispatch_repeated(double delay, double intervalInSeconds, dispatch_queue_t queue, void(^work)(BOOL *stop))
  {
      dispatch_time_t firstPopTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)delay * NSEC_PER_SEC);
      dispatch_repeated_internal(firstPopTime, intervalInSeconds, queue, work);
  }
  </code></pre>
  
  <p>It is important not to poll the scrollview values all the time. Only poll when you now there's a new value. </p>