2017-04-13 41 views

回答

1

要創建多個SEGUE到TableViewController和ViewController,您需要創建由保持集合視圖(非細胞)的視圖控制器塞格斯到目的地視圖控制器例如:

UICollectionViewController -> UIViewController1 
UICollectionViewController -> UIViewController2 
//...etc 

請記住爲每個賽段添加標識符。

而在代碼重寫UICollectionViewDelegate方法

collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) 

哪個小區被竊聽(indexPath),該方法檢查內部,並且如果它是小區1呼叫賽格瑞與權利識別符:

performSegueWithIdentifier("goToVC1Identifier", sender: nil) 
+0

出於某種原因我腦子裏想的都混在一起了。無論如何,我所做的就是將它從collectionviewcontroller連接到我的tableviewcontroller和viewcontroller並執行segue。這樣做的工作 –