I have a ViewController that is embedded in a tab bar, but also accessed by pressing a button within one of the other ViewControllers. Only if it was triggered by another ViewController, I want a cancel button to appear.
On the ViewController containing the button, I've tried passing data by setting a variable in the newViewController, but since there's a NavigationController in the way, it won't let me access it. Is there a work-around for this?
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let cancelsegue = segue.destinationViewController as! AddExerciseTableViewController
cancelsegue.cancel = segue.identifier!
}