I have a top level UIViewController
that contains a UITableView
. The top level UIViewController
instantiates a NavigationController
You could implement the methods of UINavigationControllerDelegate
and create the logic for the refreshing when popping view controllers.
Another way to do this would be implementing on your table view controller some logic on viewWillAppear
, to refresh based on the data of the popped view controller.
If you need to send data from the second view controller to the first view controller, remember that your second view controller "doesn't" know the existence of the previous view controller. It should be transparent for it. You should implement some protocol to make the second view controller send data to the first view controller. It would be a third option to this problem, since your first view controller would be the delegate and the second view controller would be sending info to the delegate, you could be preparing your table view (first view controller) to reload, based on the received data.