Apple Developer Documentation

A protocol that provides advance warning of the data requirements for a table view, allowing you to start potentially long-running data operations early.

Declaration

@MainActor protocol UITableViewDataSourcePrefetching

Overview

You use a prefetch data source object in conjunction with your table view’s data source to begin loading data for cells before the tableView(_:cellForRowAt:) data source method is called. The following steps are required to support a prefetch data source to your table view:

Note

The prefetch method is not necessarily called for every cell in the table view. For details about a suggested approach to loading data, see Loading Data Asynchronously.

When configuring the table view object, assign your prefetch data source to its prefetchDataSource property. For more information about how a table view works, see UITableView.