Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ class ContentCollectionViewController : UICollectionViewController, UICollection

cell.imageView.image = nil
appRemote.imageAPI?.fetchImage(forItem: item, with: scaledSizeForCell(cell)) { (image, error) in
// If the cell hasn't been reused
if cell.titleLabel.text == item.title {
cell.imageView?.image = image as? UIImage
}
guard let image = image as? UIImage, error == nil,
let cell = collectionView.cellForItem(at: indexPath) as? ContentItemCell else { return }
cell.imageView?.image = image
}

return cell
Expand Down