title: Moving a UIView based off of scrollViewDidScroll doesn't work when scrolling too quickly
body: <p>I have a UIScrollView that contains some subviews. The UIScrollView takes up the bottom half of the screen, and some other views take up the top half.</p>
  
  <p>Inside of <code>scrollViewDidScroll</code>, I check the scroll view's <code>contentOffset.y</code> value and when it reaches a certain limit I begin changing the <code>y</code> values of the views that take up the top half of the screen. I just increase their <code>y</code> values by 1.</p>
  
  <p>If the user begins scrolling back down then I decrease their <code>y</code> values by 1.</p>
  
  <p>This works ok, but only when scrolling very slowly. If I do a quick flick/swipe on the scroll view, the views that I am moving no longer move correctly and they get stuck in odd places.</p>
  
  <p>Here is the code that I am using:</p>
  
  <pre><code> - (void)scrollViewDidScroll:(UIScrollView *)scrollView
  {
  
  if (scrollView == self.bodyContainer &amp;&amp; scrollView.contentOffset.y &gt; 19) {
  
      if (self.lastContentOffsetY &lt; scrollView.contentOffset.y) {
  
          self.avatar.frame = CGRectMake(self.avatar.frame.origin.x, self.avatar.frame.origin.y - 1, self.avatar.frame.size.width, self.avatar.frame.size.height);
          self.name.frame = CGRectMake(self.name.frame.origin.x, self.name.frame.origin.y - 1, self.name.frame.size.width, self.name.frame.size.height);
          self.username.frame = CGRectMake(self.username.frame.origin.x, self.username.frame.origin.y - 1, self.username.frame.size.width, self.username.frame.size.height);
          self.banner.frame = CGRectMake(self.banner.frame.origin.x, self.banner.frame.origin.y, self.banner.frame.size.width, self.banner.frame.size.height - 1);
  
          } else {
  
           self.avatar.frame = CGRectMake(self.avatar.frame.origin.x, self.avatar.frame.origin.y + 1, self.avatar.frame.size.width, self.avatar.frame.size.height);
           self.name.frame = CGRectMake(self.name.frame.origin.x, self.name.frame.origin.y + 1, self.name.frame.size.width, self.name.frame.size.height);
           self.username.frame = CGRectMake(self.username.frame.origin.x, self.username.frame.origin.y + 1, self.username.frame.size.width, self.username.frame.size.height);
           self.banner.frame = CGRectMake(self.banner.frame.origin.x, self.banner.frame.origin.y, self.banner.frame.size.width, self.banner.frame.size.height + 1);
          }
      }
  
      self.lastContentOffsetY = scrollView.contentOffset.y;
  }
  </code></pre>
  
  <p>I am basically trying to accomplish something like the middle screen on this page: <a href="http://capptivate.co/2014/03/19/steller-2/" rel="nofollow">http://capptivate.co/2014/03/19/steller-2/</a></p>