Swift - UITableView scroll event

后端 未结 4 1026
深忆病人
深忆病人 2021-02-18 14:22

I was wondering how to detect if the UITableView is scrolled (up or down). I want to hide the keyboard when the UITableView is scrolled with self

4条回答
  •  感情败类
    2021-02-18 14:45

    override func scrollViewWillEndDragging(scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) {
    
            if(velocity.y>0){
                NSLog("dragging Up");
            }else{
                NSLog("dragging Down");
            }
        }
    

提交回复
热议问题