Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  2.  
  3.  
  4. if (scrollView.contentOffset.y >= scrollView.contentSize.height - scrollView.frame.size.height)
  5. {
  6.  
  7. NSLog(@"Moving Up");
  8. [UIView beginAnimations:nil context:nil];
  9. [UIView setAnimationDuration:0.3];
  10. [UIView setAnimationCurve:UIViewAnimationCurveLinear];
  11. self.view.frame = CGRectMake(0, -200, self.view.frame.size.width, self.view.frame.size.height);
  12. [UIView commitAnimations];
  13. }else if (scrollView.contentOffset.y <= scrollView.contentSize.height - scrollView.frame.size.height){
  14. NSLog(@"Moving Down");
  15.  
  16. [UIView beginAnimations:nil context:nil];
  17. [UIView setAnimationDuration:0.3];
  18. [UIView setAnimationCurve:UIViewAnimationCurveLinear];
  19. self.view.frame = CGRectMake(0,0, self.view.frame.size.width, self.view.frame.size.height);
  20. [UIView commitAnimations];
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement