I have couple of questions. How to pass the data (which i got after the Alamofire request is finished), to one of children of TabBarController?
The first problem i have
You could do something like this from the TabController class (parent):
var maleVC: MaleOptionsViewController! //First child
var femaleVC: FemaleOptionsViewController! //Second child
override func viewDidLoad() {
super.viewDidLoad()
maleVC = self.viewControllers![0] as? MaleOptionsViewController //Reference to first child
femaleVC = self.viewControllers![1] as? FemaleOptionsViewController //Reference to second child
}
And pass it data like this:
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
maleVC.cartTableView?.reloadData() //Where cartTableView is an IBOutlet or even a variable for that matter
femaleVC.cartTableView?.reloadData() //Same thing as the comment ^
}