2017-05-04 67 views
0

雖然我只在我的TableViewController一個細胞是這樣的:如何在TableViewController中設置多個segue ViewController?

enter image description here

我設置多個小區的代碼和Segue公司不同的ViewController被點擊時。

如何將我的TableViewController與多個ViewController連接,我將設置ViewController的segue標識符。

在此先感謝!

+0

您需要檢查表格單元格的值以選擇您需要的視圖控制器。 –

+0

@JackyShek謝謝,我的意思是我需要將我的每個表視圖單元格連接到不同的視圖控制器,然後我可以設置segue標識符。但在故事板中我的表格視圖控制器中只有一個單元格... – ZeKai

+0

您需要在編程中做到這一點,而不僅僅是使用故事板。這2個教程可以幫助你: https://www.ralfebert.de/tutorials/ios-swift-uitableviewcontroller/ http://www.codingexplorer.com/segue-uitableviewcell-taps-swift/ –

回答

1
  1. 使來自所述控制器的SEGUE不從細胞
  2. 呼叫的tableview的didselectrow atindexpath方法
  3. 呼叫用於與您已設置爲不同塞格斯

  4. 你標識符SEGUE一個準備完成

+1

感謝loooooooot!嘗試從TableViewController連接到其他視圖控制器,而不是從Cell! – ZeKai

相關問題