我的根视图是标签栏控制器,我想在收到特定通知时在特定标签上打开应用程序。如果我使用presentViewController,标签栏会消失。有没有具体的方法来做到这一点?
答案 0 :(得分:8)
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
}