diff --git a/ImageViewer/ViewController.swift b/ImageViewer/ViewController.swift index c3aefa0..0c4ddf3 100644 --- a/ImageViewer/ViewController.swift +++ b/ImageViewer/ViewController.swift @@ -1421,6 +1421,7 @@ extension ViewController: UICollectionViewDataSource, UICollectionViewDelegateFl withReuseIdentifier: "ScrollingImageCell", for: indexPath ) as! ScrollingImageCell + if mode != .scroll { return cell } if metadata == nil { print("metadata is nil, should probably not be the case") return cell @@ -1599,6 +1600,7 @@ class ImageLoader { } if let completion = completion { + assert(loadingTasks[key] == nil) loadingTasks[key] = completion } if let existing = activeTokens[key], !existing.isCancelled {