我希望你会很棒,关键是我想在它们之间传递数据SeondViewController并且HomeViewController导航控制器存在于它们之间,但不幸的是,我不能。我尝试使用当前调用功能,但模拟器卡住了SecondView,这是我的观点照片:
我secondViewController将数据传递给的按钮代码homeViewcontroller是:
@IBAction func nextStep(_ sender: Any) {
let thirdVC = HomeViewController()
thirdVC.cid = cityId
// present(thirdVC, animated: true, completion: nil)
}
另外,homeViewController我指向它的代码在这里:
class HomeViewController: UIViewController {
var txt : String = " "
var cid : String = " "
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
print("\n iiiiiiiiiid is \(cid) ")
}
感谢您的关注。
