如何从 AppDelegate 打开特定的选项卡视图
How can I open a specific Tab View from AppDelegate
我的根视图是一个标签栏控制器,我想在收到特定通知时在特定标签上打开应用程序。如果我使用 presentViewController,标签栏就会消失。有具体的方法吗?
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
}
我的根视图是一个标签栏控制器,我想在收到特定通知时在特定标签上打开应用程序。如果我使用 presentViewController,标签栏就会消失。有具体的方法吗?
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
}