IOS / Swift 3.0: how do you determine which rows are currently visible in a UITableView?

How do you determine which rows are currently displayed in the UITableViewController in Swift 3.0?

+4
source share
2 answers

You can use:

tableView.visibleCells

This is the array UITableViewCellthat is currently displayed in the table view.

If you only need the index paths of the visible lines, you can use:

tableView.indexPathsForVisibleRows

which is an array of objects IndexPath.

+2
source

It is pretty simple. You just need to use ...

tableView.visibleCells

From Apple docs ...

- , UITableViewCell , .

+1

Source: https://habr.com/ru/post/1666850/


All Articles