I would like to update the button title (grey button) in the first interface controller by pressing on the blue button in the second interface controller.
I was able to use the counter in order to update the label, but how would I do to send the result back to the first interface Controller
should it be executed in the second interface controller and then the result is sent back through the push segue
How would I use
pushControllerWithName("secondController",context: ... )
Should I do something like that:
var counter = 1
@IBAction func addOne() {
greyButtonLabel.setTitle("\(counter++)")
pushControllerWithName("secondController", context : add)
}
// The second interface controller
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
if let addone = context as? counter {
greyButtonLabel.setTitle("\(counter++)")
}
}