From 308439ca2bbb56d47f408edd4411f36dd28d62ee Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Sun, 3 Mar 2019 17:26:13 -0500 Subject: [PATCH] This is how the collection view should be updated The way I was doing it before was resulting in reused views getting updated by the code, which caused albums to appear in the wrong place. --- Persephone/DataSources/AlbumDataSource.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Persephone/DataSources/AlbumDataSource.swift b/Persephone/DataSources/AlbumDataSource.swift index cd8d8fd..7a5d67d 100644 --- a/Persephone/DataSources/AlbumDataSource.swift +++ b/Persephone/DataSources/AlbumDataSource.swift @@ -27,7 +27,7 @@ class AlbumDataSource: NSObject, NSCollectionViewDataSource { self.albums[indexPath.item].coverArt = image DispatchQueue.main.async { - albumViewItem.setAlbum(self.albums[indexPath.item]) + collectionView.reloadItems(at: [indexPath]) } } }