UICollectionViewDataSourcePrefetching & UICollectionViewDiffableDataSource

I can't seem to get UICollectionViewDataSourcePrefetching working with DiffableDatasource, my delegate methods are not being called. Do these work together?

Code Block swift
func viewDidLoad()
....
        collectionView.prefetchDataSource = self
        collectionView.isPrefetchingEnabled = true
}
extension ViewController: UICollectionViewDataSourcePrefetching {
    func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) {
        let urls: [URL] = indexPaths.compactMap { indexPath in
            guard let displayableItem = dataSource.itemIdentifier(for: indexPath),
                let itemViewModel = displayableItem.item as? ViewModel,
                let image = itemViewModel.firstImageURL else {
                    return nil
            }
            return image
        }
        ATHLogging.log.critical("prefetching: \(urls)")
        preheater.startPreheating(with: urls)
    }


Replies

Just an update here still not working, tho I have verified my guards work correctly, and adding a log statement on 10 of this post does not get called
I have the same issue. I modified the SimpleListViewController in the Apple sample Implementing Modern Collection Views. I changed it with 1000 items in the model. The Prefetch Data Source it is only called once....