質問編集履歴

1

具体的に

2019/02/25 03:10

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- 関数に受け渡したカスタムセルのindexPathを取得したいのですが、なぜかnilになってしまいます
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)