How can I open a specific Tab View from AppDelegate
Asked Answered
D

1

8

My root view is a tab bar controller, I would like to open the app on a specific tab when a certain notification is received. If I use presentViewController the tab bar disappears. Is there a specific way to do this?

Danby answered 27/8, 2016 at 12:24 Comment(0)
M
12
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    let myTabBar = self.window.rootViewController as! UITabBarController // Getting Tab Bar
    myTabBar.selectedIndex = 2 //Selecting tab here
    return true
}
Mordvin answered 28/8, 2016 at 15:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.