i have two view controllers and i want to pass data from 1st view to the second when i press ok button and move to the 2nd view without passing any data when i press cancel
i wrote this code
@IBAction func submitL() {
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
var third = segue.destinationViewController as ViewController
third.lastName = theLastName.text
third.name = theName.text
}
}
this code didn't work