I have a TableViewConroller embedded in a NavigationController which is has a relationship segue of view controllers. That part works great. What doesn't work is the
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print("refresh")
tableView.reloadData()
}
It only fires when the tab is first pressed. I have tried a few suggestions and nothing will refresh the table. Including:
class TabBarControllerViewController: UITabBarController, UITabBarControllerDelegate {
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
print("Selected item")
print(item.tag)
if item.tag == 3 {
DispatchQueue.main.async(execute: {AlertsTableViewController().buttonMethod()})
}
}
Any suggestions?
This is what I found, but isn't working: How to refresh a tableView on click tabBar item Swift?