Instance Method

tableView(_:cancelPrefetchingForRowsAt:)

Cancels a previously triggered data prefetch request.

Declaration

optional func tableView(_ tableView: UITableView, cancelPrefetchingForRowsAt indexPaths: [IndexPath])

Parameters

tableView

The table view issuing the cancellation of the prefetch request.

indexPaths

The index paths that specify the locations of the items for which the data is no longer required.

Discussion

The table view calls this method to cancel prefetch requests as cells scroll out of view. Your implementation of this method is responsible for canceling the operations initiated by a previous call to tableView(_:prefetchRowsAt:).For further information about canceling an asynchronous data loading task, see Concurrency Programming Guide.