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
For Xcode 8, Swift 3.x you can use something like the following. This assumes you have your view controller embedded in a navigation controller. In my situation, I am trying to set a variable called startWizard
to true when navigating from the new user setup view.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "segueFromNewUserToDashboard") {
let dashboardController = segue.destination as! MyTabBarController
for viewController in dashboardController.viewControllers! {
let navViewController = (viewController as! MyNavigationController).topViewController!
if (navViewController.isKind(of: DashboardViewController.self) == true) {
(navViewController as! DashboardViewController).startWizard = true
break
}
}
}
}