Instance Method


Tells your prefetch data source object to begin preparing data for the cells at the supplied index paths.



- (void)collectionView:(UICollectionView *)collectionView prefetchItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;



The collection view issuing the prefetch request.


The index paths that specify the locations of the items for which the data is to be prefetched.


The collection view calls this method as the user scrolls, providing the index paths for cells it is likely to display in the near future. Your implementation of this method is responsible for starting any expensive data loading processes. The data loading must be performed asynchronously, and the results made available to the collectionView:cellForItemAtIndexPath: method on the collection view’s data source.

The collection view does not call this method for cells it requires immediately, so your code must not rely on this method to load data. The order of the index paths provided represents the priority.

For further information about creating an asynchronous data loading task, see Concurrency Programming Guide.

See Also

Managing Data Prefetching

Prefetching Collection View Data

Load data for collection view cells before they are displayed.

- collectionView:cancelPrefetchingForItemsAtIndexPaths:

Cancels a previously triggered data prefetch request.