Hi all I want to segue from first tabbarcontroller to second tabbarcontroller but not able to do so. View Controllers in my TabBar are also embedded with NavigationControllers ,and so when i try to switch tabs it gives me error saying-:
Could not cast value of type 'UINavigationController' (0x1048d5898) to 'abc.CategoriesController' (0x101088d88).
Code I used-:
let barViewControllers = self.tabBarController?.viewController
let svc = barViewControllers![1] as! myController
svc.myOrder = self.myOrder
I tried many solutions but failed to segue can anyone help me? Please explain me concept behind this if anyone can?
self.tabBarController.selectedIndex = 1
does work but I can not pass data with this method.
As Maddy said-:
Use let barViewControllers = self.tabBarController?.viewController[1] as? myController
to pass data.
But this is the line that gives me above crash