1
如下圖所示,我有一個CollectionViewCell,並希望爲TableViewController和ViewController創建多個segue。創建多個segue使用CollectionView
如何創建多個segue?
如下圖所示,我有一個CollectionViewCell,並希望爲TableViewController和ViewController創建多個segue。創建多個segue使用CollectionView
如何創建多個segue?
要創建多個SEGUE到TableViewController和ViewController,您需要創建由保持集合視圖(非細胞)的視圖控制器塞格斯到目的地視圖控制器例如:
UICollectionViewController -> UIViewController1
UICollectionViewController -> UIViewController2
//...etc
請記住爲每個賽段添加標識符。
而在代碼重寫UICollectionViewDelegate
方法
collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath)
哪個小區被竊聽(indexPath),該方法檢查內部,並且如果它是小區1呼叫賽格瑞與權利識別符:
performSegueWithIdentifier("goToVC1Identifier", sender: nil)
出於某種原因我腦子裏想的都混在一起了。無論如何,我所做的就是將它從collectionviewcontroller連接到我的tableviewcontroller和viewcontroller並執行segue。這樣做的工作 –