I have a
UITableView
override func viewDidLoad() {
self.fetchData()
self.dataTable.reloadData()
}
override func viewWillAppear(animated: Bool)
{
self.fetchData()
self.dataTable.reloadData()
}
You have to remember that viewDidLoad() is only called once during navigation segues. So, after it's loaded, the only time you'll know that the view has popped up again is in the viewWillAppear().
Have you tried:
override func viewWillAppear(animated: Bool)
{
self.clearData()
//Once you've reset all your variables, populate them again.
self.fetchData()
self.audioData.reloadData()
self.dataTable.reloadData()
}
If I'm wrong, and your viewDidLoad() method is being called every time the view appears, then your code should work. You can always put print statements in each function to see what's being called, and what isn't. Let me know if this helps :)