Hi,
There are two view involved here. For clarity call them VC1 and popup VC.
The popup VC is presented as a popover segue from VC1 and the segue is defined in the IB.
What I want to do is when the popup VC is dismissed I need to trigger the tableView array to be re-built and the tableView to be reloaded on VC1. I know how to do tableview work. However, viewDidAppear, viewDidLoad, viewWillAppear, etc. obviously don't run in this circumstance. What I haven't been able to figure out is how to determine when VC1 becomes active again in order to run the necessary tableView code.
Thanks in advance.
The only additional code for the segue is below.
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
{
if segue.identifier == "tally_pop"
{
let popupVC = segue.destination as! Tallly_Popover_VC
popupVC.preferredContentSize = CGSize(width: 300, height: 462)
}
}
(I don't do Swift or Storyboards...)
A simple solution is a postNotificationName in viewWillDisappear (or the action that causes the view to dismiss itself) of the child and an addObserver: in the parent.
//in child
[[NSNotificationCenter defaultCenter] postNotificationName:@"ClosingChild" object:self];
//in parent
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(refreshTableMethod)
name:@"ClosingChild" object:nil];