I have an TableViewController which uses a push-segue to navigate to a subview. I would like the parent-controller to be informed, when the subview has been closed. How do I do that?
Sorry, I think it's too late for me...
I have an TableViewController which uses a push-segue to navigate to a subview. I would like the parent-controller to be informed, when the subview has been closed. How do I do that?
Sorry, I think it's too late for me...
Is the only way to close it to go back?
If yes, you'll know when viewWillAppear:
is called.
If not, use the delegate pattern to communicate between view controllers. (See What's the best way to communicate between view controllers?)
After reading, sleeping, reading and thinking again, I think, the best way should be to do it really right ;-)
First of all, I will update my data-handling to be more 'model-driven'. I will offer the sub controller the data it needs to work (actually it fetches these on its own).
Second thing would be, that the main controller will observe this model and therefor don't need to be informed to update data because of the closing sub controller.
This is not the answer the the original questing, but it is, what I learned from the given answers. Thanks for helping me ordering the thoughts.
Better do it right from the beginning...