回答編集履歴
2
誤記修正
answer
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
DispatchQueue.main.async{
|
6
6
|
// cellは適当に自分のセルの型に変換してください
|
7
7
|
let cell = self.collectionView.cellForItem(at:index)
|
8
|
-
cell?.
|
8
|
+
cell?.photoView.image = image
|
9
9
|
}
|
10
10
|
```
|
11
11
|
|
1
追記
answer
CHANGED
@@ -7,4 +7,7 @@
|
|
7
7
|
let cell = self.collectionView.cellForItem(at:index)
|
8
8
|
cell?.imageView.image = image
|
9
9
|
}
|
10
|
-
```
|
10
|
+
```
|
11
|
+
|
12
|
+
cellForItemAt の cell.photoView.image = self.image は不要です。
|
13
|
+
あと、現状だとセルが表示されるたびに読み込みが発生するので、多少キャッシュするような処理が必要になると思います。
|