Hi,
I have 5 tab bars, when I press one of them I want the viewController's data to be refreshed.
I'm using this code:
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
let tabBarIndex = tabBarController.selectedIndex
if tabBarIndex == 4 {
self.collectionView.reloadData()
viewDidLoad()
}
}every time I'm pressing the tab bar for the specific viewController,
the view and the data inside the collection view cell is refreshed,
but the collectionView triples the cells.
is there another way to refresh the data?
thank you