检测UITableView何时滚动到底部 [英] Detect when UITableView has scrolled to the bottom

查看:72
本文介绍了检测UITableView何时滚动到底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下文章是否仍然是检测UITableView实例何时滚动到底部的方法?

无法检测UITableView是否滚动到底部的问题

谢谢.

解决方案

Swift 3

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
    if indexPath.row + 1 == yourArray.count {
        print("do something")
    }
}

Is the following post still the accepted way of detecting when an instance of UITableView has scrolled to the bottom [in Swift], or has it been altered (as in: improved) since?

Problem detecting if UITableView has scrolled to the bottom

Thank you.

解决方案

Swift 3

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
    if indexPath.row + 1 == yourArray.count {
        print("do something")
    }
}

这篇关于检测UITableView何时滚动到底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆