I created a prepare segue function when user click "ok" on UIAlret it will go to 3rd tab controller in BaseTabBarViewController but I have a problem with prepare function is always going to the 1st tab
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if(segue.identifier == "segueToUsersTab"){
if let tabVC = segue.destination as? BaseTabBarViewController{
tabVC.selectedIndex = 2
}
}
}
You are using old prepare for segue method. The fix change it to override func prepare(for segue: UIStoryboardSegue, sender: Any?) {