如下图所示,我有一个CollectionViewCell,希望为TableViewController和ViewController创建多个索引。
我怎样才能创建一个以上的词组呢?
发布于 2017-04-13 15:43:10
要为TableViewController和ViewController创建多个segue,您需要从持有集合视图(而不是单元格)的视图控制器创建一个segue,例如:
UICollectionViewController -> UIViewController1
UICollectionViewController -> UIViewController2
//...etc
记住要向每个语言添加标识符。
在代码中重写UICollectionViewDelegate
方法
collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath)
在该方法中,检查哪个单元格被点击(indexPath),如果它是带有正确标识符的cell1调用segue:
performSegueWithIdentifier("goToVC1Identifier", sender: nil)
https://stackoverflow.com/questions/43403187
复制相似问题