//属性
@property (nonatomic, assign) CGPoint markPoint;
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
_markPoint = scrollView.contentOffset; // 记录开始滑动时的坐标
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
if (_markPoint.x > scrollView.contentOffset.x) {
//向右➡️
}
if (_markPoint.x < scrollView.contentOffset.x) {
//向左⬅️
}
if (_markPoint.y > scrollView.contentOffset.y) {
//向下⬇️
}
if (_markPoint.y < scrollView.contentOffset.y) {
//向上⬆️
}
}
网友评论