質問編集履歴
1
具体的に
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
CollectionViewDelegateでindexPath(for: cell)を使ってセルのindexPathを取得したいのですが、
|
6
|
+
|
7
|
+
なぜかnilが帰ってきてしまいます
|
8
|
+
|
9
|
+
|
6
10
|
|
7
11
|
|
8
12
|
|
@@ -78,6 +82,8 @@
|
|
78
82
|
|
79
83
|
private func indexSet(cell: TestCollectionCell){
|
80
84
|
|
85
|
+
//ここでindexPathを取得したいが、nilになってしまう
|
86
|
+
|
81
87
|
let index = self.testCollection.indexPath(for: cell)
|
82
88
|
|
83
89
|
cell.testText.text = String(describing: index?.row)
|