我有一个使用不同视图控制器的注册流程。我从ViewController1中的用户获取输入,移动到下一个视图控制器(ViewController2),并将数据传递到最后一个视图控制器(例如ViewController5)。将数据传递给另一个ViewController而不移动到ViewController
的问题是,我可以通过我的数据到下一个视图控制器,但我不能把它传递给最后一个视图控制器,如:
// Move to Second View of the flow.
let secondViewController = self.storyboard?.instantiateViewController(withIdentifier: “SecondViewController“) as! SecondViewController
secondViewController.dataText = dataText!
self.navigationController?.show(secondViewController, sender: nil)
// Pass the data to the last View of the flow.
let fifthViewController = self.storyboard?.instantiateViewController(withIdentifier: “FifthViewController“) as! FifthViewController
fifthViewController.dataText = emailText!
的dataText
将传递给SecondViewController
但不FifthViewController
。我如何实现这一目标?
这正是我所需要的。很好,谢谢。 – waseefakhtar