From 99711c8365370f674eecfd130899b23e393385cd Mon Sep 17 00:00:00 2001 From: k2645 <k2645@naver.com> Date: Thu, 5 Dec 2024 01:46:38 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B9=A0=EB=A5=B4=EA=B2=8C=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EB=82=B4=EB=A6=B4=EC=8B=9C=20=EC=82=AC?= =?UTF-8?q?=EC=A7=84=20=EB=B0=B0=EC=97=B4=20=EC=9D=B4=EC=83=81=ED=95=B4?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomAlbum/View/CustomAlbumCollectionViewCell.swift | 1 + .../Source/CustomAlbum/View/CustomAlbumViewController.swift | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumCollectionViewCell.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumCollectionViewCell.swift index 98c0969e..2e06c669 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumCollectionViewCell.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumCollectionViewCell.swift @@ -9,6 +9,7 @@ final class CustomAlbumCollectionViewCell: UICollectionViewCell { return imageView }() + var representedAssetIdentifier: String? // MARK: - Initialize override init(frame: CGRect) { diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumViewController.swift index 8f5f9237..1019fec6 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumViewController.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/CustomAlbum/View/CustomAlbumViewController.swift @@ -322,10 +322,13 @@ extension CustomAlbumViewController: UICollectionViewDataSource { cell.setPhoto(.photo) } else { guard let asset = viewModel.photoAsset?[indexPath.item - 1] else { return cell } + cell.representedAssetIdentifier = asset.localIdentifier let cellSize = cell.bounds.size Task { await LocalPhotoManager.shared.requestThumbnailImage(with: asset, cellSize: cellSize) { image in - cell.setPhoto(image) + if cell.representedAssetIdentifier == asset.localIdentifier { + cell.setPhoto(image) + } } } }