title: How can I programmatically force-stop scrolling in a UIScrollView?
body: <p>Note: The <a href="https://stackoverflow.com/questions/986392/programmatically-force-a-uiscrollview-to-stop-scrolling-for-sharing-a-table-view">answer given here</a> doesn't work for me.</p>
  
  <p>I have a UIScrollView (not a table view, just a custom thing), and when the user takes certain actions, I want to kill any scrolling (dragging or deceleration) inside the view. I've tried doing e.g. this:</p>
  
  <pre><code>[scrollView scrollRectToVisible:CGRectInset([scrollView bounds], 10, 10) animated:NO];
  </code></pre>
  
  <p>on the theory that, given a rect that's already known visible, the scrolling will just stop where it is, but it turns out that this doesn't have any effect-- apparently the scroll view sees that the given rect is in bounds and takes no action. I <strong>can</strong> get the scroll to stop, if I give a rect that is definitely <strong>outside</strong> the currently-visible bounds, but inside the contentSize of the view. This seems to halt the view as expected... but also causes it to jump to some other location. I could probably do a little playing around at the margins to get this to work reasonably OK, but does anyone know of a clean way to halt a scroll view that's doing its thing?</p>
  
  <p>Thanks.</p>