Reputation: 520
I have setting like this:
First controller reads data and sets in Second Controller. Second Controller has a button that executes push segue to Third Controller with a countdown. After countdown I want to go back from third controller to second that should still have data. Is there any way to achieve this?
Also I am using Storyboards.
I send data to Second Controller in prepare func. Second to Third controller change is connected directly to button in Storyboards.
override func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) {
let controller = segue.destination as! QuestionViewController
controller.questionIDs = sender as! [Int]
}
To come back from Third to Second controller I use this code from Third controller:
self.performSegue(withIdentifier: "nobodyAnsweredSegue", sender: self)
Upvotes: 0
Views: 251
Reputation: 7168
Change this:
self.performSegue(withIdentifier: "nobodyAnsweredSegue", sender: self)
To this:
self.navigationController?.popViewControllerAnimated(true)
Upvotes: 1