我有一个 UI View Controller (viewControllerOne),其中有一个 TableView 。我有一个从单元格中的按钮到另一个 View Controller (viewControllerTwo)的segue。
这很好用。
现在,我有第三个 View Controller ,并且希望从 View Controller 中的另一个按钮进行转场。
如何从一个 View Controller 进行多个转场以转到不同的 View Controller 。
最佳答案
第一个segue应该在VC本身(而不是单元格内的按钮)到目标VC之间,以便能够在prepareforSegue
中发送数据,因此从VC1的黄色图标拖动到VC2和 VC3 并分别给出一个 segue 标识符,例如 toSecond 和 toThird 然后在代码中执行
// change segue identifier if you want to third
self.performSegue(withIdentifier: "toSecond ", sender:nil)
关于ios - 如何从一个 viewController 添加多个 Segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51119952/