Try this one Passing data with segue through navigationController but I need one more step before UITabBarController
ViewController->UITabBarController->UINavigationController->RestaurantTableViewController
The destination view controller of the segue is the UITabBarController
. How can I get the real destination RestaurantTableViewController
:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == segueIdentifire() {
let dcTabBar = segue.destination as! UITabBarController
let dcNabBar = //i don't know what should i write here?
let dc = dcNabBar.topViewController as! RestaurantTableViewController
dc.dcTitle = "Restaurant"
}
}