I have a submit UIButton that is targeted at this function and I have a textField that I want to pass onto the next view controller. So the user would type into the textField and whatever it is typed, once the user taps on the submit button, the string inside the text field will be passed onto the next view controller's UILabel.
func submitTapped() {
let secondViewController = SecondViewController(nibName: nil, bundle: nil)
navigationController?.pushViewController(secondViewController, animated: true)
print("Button tapped")
}
}
How do I push that string though the second controller? Also, I have tried using prepareForSegue, but I think this has nothing to do with segues as we are not transitioning screen via a segue, we are transitioning via a navigation controller, am I right?
thanks!