I am trying to change tab bar in didFinishLaunchingWithOptions method programmatically, but it won't work, any idea?
I have tried:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if let tabBarController = self.window!.rootViewController as? UITabBarController {
tabBarController.selectedIndex = 0
}
return true
}
Thanks,