我有一個自定義的CollectionViewCell類,然後我在CollectionView中生成了一些這些內容。當ViewCell被觸摸時,我還添加了一個模態輪廓。如何激活模態切入點時獲得哪個單元格的id(或索引路徑)。獲取UICollectionViewCell的indexPath
我看到這裏,有人建議我加入到ViewCell.m文件的方法
-(void)collectionView: (UICollectionView*)collectionView didSelectItemAtIndexPath: (NSIndexPath*)indexPath{
//get indexpath variable in here
}
但這種方法似乎並不被獲取調用。任何人都可以幫助我,當CollectionViewCell具有模態segue來獲取indexpath時,需要調用什麼方法。
感謝,
感謝格式升級Vineet! –