title: What is the correct way of setting the current thread NSRunLoop to run in a certain mode until I decide to stop it?
body: <p>I want to mimic the UIScrollView behavior where the current thread RunLoop mode changes to UITrackingRunLoopMode when you drag the scrollView, and back to NSDefaultRunLoopMode when you stop dragging. </p>
  
  <p>I want to do it with my own class, though, dragging around views... Right now I'm using this code</p>
  
  <pre><code>while (_draggingView &amp;&amp; [[NSRunLoop currentRunLoop] runMode:UITrackingRunLoopMode beforeDate:[NSDate distantFuture]]);
  </code></pre>
  
  <p>When I stop dragging, _draggingView changes to nil so I stop looping in that mode. Is there a more elegant/better way of doing this?</p>
  
  <p>How is UIScrollView doing it? Input sources?</p>
  
  <p>Thank you</p>