Skip to content

Instantly share code, notes, and snippets.

@thomasdegry
Created January 22, 2015 20:03
Show Gist options
  • Save thomasdegry/24a9ef825abfed752c53 to your computer and use it in GitHub Desktop.
Save thomasdegry/24a9ef825abfed752c53 to your computer and use it in GitHub Desktop.
if(scrollView.contentOffset.y <= self.maxScrollDistance) {
NSLog(@"REGULAR");
float newY = self.startScrollViewY - scrollView.contentOffset.y / 3;
float newScrollViewHeight = self.view.frame.size.height - newY;
scrollView.frame = CGRectMake(0, newY, self.scrollView.frame.size.width, newScrollViewHeight);
} else if(scrollView.contentOffset.y < 0) {
NSLog(@"NEGATIVE");
float newY = self.startScrollViewY - scrollView.contentOffset.y / 3;
float newScrollViewHeight = self.view.frame.size.height - newY;
scrollView.frame = CGRectMake(0, newY, self.scrollView.frame.size.width, newScrollViewHeight);
}
@NSSakly
Copy link

NSSakly commented Jan 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment