1

I would like to update my UITableView when a Tab Bar Item is clicked. (I am open to any other better suggestions of how to do this besides when the Tab Bar Item is clicked). Thanks for any help :)

Tab Bar Item

Adam Strike
  • 356
  • 1
  • 4
  • 16

3 Answers3

1

I solved it by putting the update code in the viewDidAppear() method

Adam Strike
  • 356
  • 1
  • 4
  • 16
0

Put your table view's update code in its view controller's viewWillAppear(), which should get called every time the tab is tapped.

NRitH
  • 13,441
  • 4
  • 41
  • 44
0

Implement this delegate

optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController)

Proton
  • 1,335
  • 1
  • 10
  • 16
  • I tried using this method but it didn't work. I think it was because I didn't connect it to the actual button properly, how would I do that? – Adam Strike Jun 28 '16 at 16:56