I\'m almost finished with a project and am working out the last few UI kinks. My app uses a tab bar to navigate and for aesthetic purposes I want the app to open on the last
If you're using UISegue
from UIStoryBoard
, you can use this in UIViewController
where you're performing UISegue
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let tabBarController = segue.destination as? UITabBarController
tabBarController?.selectedIndex = 1
}
or
class TabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
self.selectedIndex = 1
}
}
this code in your UITabBarController
itself.