You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extensionTheatreVideoVC:UICollectionViewDataSourcePrefetching{
// TikTok eager download - fetch 5 movies as soon as possible on app start
// get the next X videos / start downloading them...
func collectionView(_ collectionView:UICollectionView, prefetchItemsAt indexPaths:[IndexPath]){
if indexPaths.count >=1{letindexPath=indexPaths[0]letidx0=IndexPath(row: indexPath.row, section:0)letidx1=IndexPath(row: indexPath.row+1, section:0)letidx2=IndexPath(row: indexPath.row+2, section:0)letidx3=IndexPath(row: indexPath.row+3, section:0)letidx4=IndexPath(row: indexPath.row+4, section:0)letprefetchIndexPaths=[idx0, idx1, idx2, idx3, idx4]
for idx in prefetchIndexPaths {self.prefetchItem(idx: idx)}}}privatefunc prefetchItem(idx:IndexPath){print("INFO:prefetchItem \(idx)")
if self.feedCollectionView !=nil{
if self.feedCollectionView.isValid(indexPath: idx){
if let video =self.theatreDataSource?.itemIdentifier(for: idx)as?Video{Celestial.shared.startDownload(for: video.url)}}}}
I used this mistakenly Celestial.shared.prefetchResources(at: [url]) - and performance was crap. Was prepared to throw in bin - but when I switched to simple Celestial.shared.startDownload(for: video.url) - it's all good AND smooth. I think it's the sync calls in prefetch that cause scrolling to come unstuck.
The text was updated successfully, but these errors were encountered:
I used this mistakenly Celestial.shared.prefetchResources(at: [url]) - and performance was crap. Was prepared to throw in bin - but when I switched to simple Celestial.shared.startDownload(for: video.url) - it's all good AND smooth. I think it's the sync calls in prefetch that cause scrolling to come unstuck.
The text was updated successfully, but these errors were encountered: