ASCollectionView
ASCollectionView copied to clipboard
Crash in prefetcher
Describe the bug When scrolling the PhotoView in the demo app the app crashed in the prefetcher call to the onCell prefetch method.
Crash occurred on onCellEvent?(.prefetchForData(data: dataToPrefetch)) in ASSectionDataSource
The call is on the background thread
func prefetch(_ indexPaths: [IndexPath])
{
let dataToPrefetch: [Data] = indexPaths.compactMap
{
data[safe: $0.item]
}
onCellEvent?(.prefetchForData(data: dataToPrefetch))
}
To Reproduce Run the demo app, rapidly scroll through photo content until the crash occurs. (I had been testing the memory by going in and out of the AppStore Layout view repeatedly prior to this).
ASCollectionView version Latest master (1.7)
Xcode Version: 12.1.1
Simulator, Device, Both? iPhone 12 pro Max, iOS 14.1