The goal is to unwind from secondVC to firstVC. And I want to do it from the scene itself, but Xcode doesn't recognise this segue.
What I'm doing is:
Control-drag from the secondVC scene in the Document Outline to the secondVC's Exit
Choose my unwind segue, that I created on firstVC
Give newly created segue an identifier - "SaveData".
Trying to call that segue through "performSegue" function
performSegue(withIdentifier: SaveData, sender: self)
But it shows a mistake, that identifier doesn't exist - "Cannot find 'SaveData' in scope"
Here is the screenshot
What am I doing wrong?
Xcode 14.0.1
CodePudding user response:
OMG, I forgot that identifier should be put in quotation marks. Should be like this:
performSegue(withIdentifier: "SaveData", sender: self)