I want to print a variable when a bar button item (on the navigation bar) is pressed. When this bar button item is pressed an unwind segue will happen whilst a variable is set and then it will be printed to the console (log at the bottom of Xcode). This is my code:
@IBAction func doneNavItem(_ sender: AnyObject) {
textField.text = var variableUnwind
print(variableUnwind)
}
I know that the unwind segue is being triggered before the variable can be printed from How to do something before unwind segue action? but the solutions on here do not seem to work or I might be reading it wrong.
Thanks