首先设置一个旧的偏移量为0;
self.oldContent = 0;
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView.contentOffset.y > _oldContent) {
//如果当前位移大于缓存位移,说明是tableView向下移动
[self foldingViewDidAnimateToFold];
} else {
[self foldingViewDidAnimateToFlat];
}
_oldContent = scrollView.contentOffset.y;
}