判断ScrollView上下滑动
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let vel = scrollView.panGestureRecognizer.velocity(in: scrollView)
if vel.y > 0 {
//向上滑动
setToolBarHidden(false)
}
else if vel.y < 0 {
//向下滑动
setToolBarHidden(true)
}
}
网友评论