Created
January 22, 2015 20:03
-
-
Save thomasdegry/24a9ef825abfed752c53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/a/28097548/2833978