Entering a state Boolis like another answer indicating a very bad one and should be avoided if possible, as this greatly increases the complexity of your application.
: delegate Controller2.
protocol Controller2Delegate {
func controller2DidReturn()
}
class Controller1: Controller2Delegate {
func controller2DidReturn() {
}
func prepareForSegue(...) {
controller2.delegate = self
}
}
class Controller2 {
var delegate: Controller2Delegate!
func done() {
delegate.controller2DidReturn()
}
}
.