Created
January 30, 2015 09:32
-
-
Save modamoda/e09f46d1850155a94519 to your computer and use it in GitHub Desktop.
iOS UIScrollView: How to detect scrolling direction
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
// http://stackoverflow.com/a/21806997/893945 | |
@interface MyViewController : UIViewController <UIScrollViewDelegate> | |
@end | |
@implementation MyViewController | |
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView | |
{ | |
if([scrollView.panGestureRecognizer translationInView:scrollView.superview].y < 0) { | |
// up | |
} else { | |
// down | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not work