Mr *_*ike 6 tabbarcontroller appdelegate swift
我的根视图是标签栏控制器,我想在收到特定通知时在特定选项卡上打开应用程序.如果我使用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
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2537 次 |
最近记录: |