I've got a login page on the main View Controller
which passes a "verified"
string to EslViewController
, this, I can get to work, but it's now when I want to pass this "verified"
to IP_ModuleViewController
that I'm having issues with...
the code at the moment is;
@IBAction func backButton(_ sender: Any) {
if installer == "verified"{
performSegue(withIdentifier: "main/login", sender: self)
}
func prepare(for segue: UIStoryboardSegue, sender: Any?){
let mainController = segue.destination as! ViewController
mainController.myvar = installer
}
}
@IBAction func button1(_ sender: Any) {
if installer == "verified"{
performSegue(withIdentifier: "Button1", sender: self)
}
func prepare(for segue: UIStoryboardSegue, sender: Any?){
let IPController = segue.destination as! IP_ModuleQuickStartViewController
IPController.verified = installer
}
}
Now, my problem is that the func prepare(for segue: UIStoryboardSegue, sender: Any?)
isn't running, I realize that this is because it's not an Override Func (I think), but if I have the override func instead I can only see that you can pass data from one? so the second IBAction (button 1) won't work because the Override Func for the back button which goes to ViewController
also runs when it's meant to be going to IPcontroller
, Any ideas?