title: setContentOffset on UIScrollView the right way
body: <p>I'm using this code to scroll my <code>UIScrollView</code> down because I'm adding a new <code>UIView</code> on it from the bottom and I want to scroll down to it. I do it like this:</p>
  
  <pre><code>CGPoint newOffset = CGPointMake(mainScrollView.contentOffset.x, mainScrollView.contentOffset.y + floorf(bottomAttachmentView.frame.size.height / bottomAttachmentView.multFactor));
  [mainScrollView setContentOffset:newOffset animated:YES];
  </code></pre>
  
  <p>I basically add my new element's height to the <code>y</code> of <code>UIScrollView</code>'s <code>contentOffset</code> but sometimes it scrolls out of the scrollView <code>contentSize</code>, lower, that it is possible to scroll. It happens because I modify the <code>contentSize</code> before calling the method above and the height of the Scroll View shrinks. </p>
  
  <p>How do you call the <code>setContentOffset</code> so it wouldn't make my scrollView scroll out of it's own <code>contentSize</code>? Thanks!</p>