Objective c 如何确定是否显示tableViews页脚?

Objective c 如何确定是否显示tableViews页脚?,objective-c,swift,xcode,uitableview,Objective C,Swift,Xcode,Uitableview,我有一个tableView,我想知道页脚何时显示 @available(iOS 6.0, *) optional func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) 方法来获取这个我使用scrollView来计算tableView的结尾 override func scrollViewDidScroll(_ scrollView: UIScro

我有一个tableView,我想知道页脚何时显示

@available(iOS 6.0, *)
optional func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int)

方法来获取这个

我使用scrollView来计算tableView的结尾

override func scrollViewDidScroll(_ scrollView: UIScrollView) {
        let height = scrollView.frame.size.height
        let contentYoffset = scrollView.contentOffset.y
        let distanceFromBottom = scrollView.contentSize.height - contentYoffset
        if distanceFromBottom < height {
            // end of tableView
            
        }
    }
覆盖函数scrollViewDidScroll(scrollView:UIScrollView){
让高度=scrollView.frame.size.height
让contentYoffset=scrollView.contentOffset.y
让distanceFromBottom=scrollView.contentSize.height-contentYoffset
如果距离底部<高度{
//表视图结束
}
}

我还使用了Bool来理解第一次显示页脚是什么时候

谢谢你的回答,但我的问题是tableView页脚,而不是节页脚。你可以观察内容偏移