My project has a few view controllers, let’s say A and B.
In A I have a UITableView. When a row is selected, I pass the row number and cell text to view B, then pushViewController B.
In view B, when hitting the ‘done’ button I make changes to the underlying data (right now a Singleton array) and then pop back to view A. In view A viewDidAppear, I reload the UITableView to see the new data.
Is this the best way to do it?
Or should I be reloading the UITableView when the ‘done’ button is hit?
If so, how do I reload a Table in view A from within view B?
Thanks.
It is better to reload the data directly when you hit the “Done” button. You can do that by a Notification Center. Please check this link for more details about Notification Center.