you should check ios UITableViewDataSourcePrefetching.
class ViewController: UIViewController {
@IBOutlet weak var mytableview: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
mytableview.prefetchDataSource = self
}
func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) {
print("prefetchdRowsAtIndexpath \(indexPaths)")
}
func tableView(_ tableView: UITableView, cancelPrefetchingForRowsAt indexPaths: [IndexPath]) {
print("cancelPrefetchingForRowsAtIndexpath \(indexPaths)")
}
}