-
(void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGPoint scrollVelocity = [scrollView.panGestureRecognizer translationInView:self.view];
if (scrollVelocity.x > 0) {
// 向左滑
}else {
// 向右滑
}if (scrollVelocity.y > 0) {
// 向上滑
}else{
// 向下滑
}
}
(void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGPoint scrollVelocity = [scrollView.panGestureRecognizer translationInView:self.view];
if (scrollVelocity.x > 0) {
// 向左滑
}else {
// 向右滑
}
if (scrollVelocity.y > 0) {
// 向上滑
}else{
// 向下滑
}
}
本文标题:iOS - Collection判断滑动方向
本文链接:https://www.haomeiwen.com/subject/wmtluktx.html
网友评论