判断UIScrollView 滑动方向

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    
    CGPoint translatedPoint = [scrollView.panGestureRecognizer translationInView:scrollView];

    if(translatedPoint.y < 0){
        NSLog(@"上滑");
    }
    if(translatedPoint.y > 0){
        NSLog(@"下滑");
    }
    //通过translatedPoint.x 判断左右滑动方向
}

你可能感兴趣的:(判断UIScrollView 滑动方向)