我有一個UITableViewCell
子類,其中每個表格單元格包含一個UICollectionView
多個UIcollectionViewCell
s。如何使用Segue選擇UICollectionViewCell時
我需要點擊任何collectionViewCell
時必須打開一個新的viewController。
我已重寫以下方法,
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
正如我的UITableViewCell子類已經實現了整體的CollectionView所以我無法呼叫[self performSegueWithIdentifier:@"NewViewController" sender:self];
我已經在同一個班級嘗試prepareForSegue
但它加載新的viewController之前didSelectItemAtIndexPath
方法。
工作是啊這解決了我的問題。謝謝@Zartha –
@AhmadNauman快樂編碼! – Zartha