📜  swift collection view 检查你是否在底部 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:03.194000             🧑  作者: Mango

代码示例1
func scrollViewDidScroll(_ scrollView: UIScrollView) {
    let height = scrollView.frame.size.height
    let contentYoffset = scrollView.contentOffset.y
    let distanceFromBottom = scrollView.contentSize.height - contentYoffset
    if distanceFromBottom < height {
        print(" you reached end of the table")
    }
}