UITableView是UIScrollView的子类,实现其代理方法
func scrollViewWillBeginDragging(scrollView: UIScrollView) {
lastContentOffset = scrollView.contentOffset.y
}
func scrollViewWillBeginDecelerating(scrollView: UIScrollView) {
if (scrollView.contentOffset.y > lastContentOffset){ //如果当前位移大于缓存位移,说明scrollView向上滑动
}