【问题标题】:How can I open a specific Tab View from AppDelegate如何从 AppDelegate 打开特定的选项卡视图
【发布时间】:2016-08-27 12:24:06
【问题描述】:

我的根视图是一个标签栏控制器,当收到某个通知时,我想在特定标签上打开应用程序。如果我使用 presentViewController,标签栏就会消失。有具体的方法吗?

【问题讨论】:

    标签: swift appdelegate tabbarcontroller


    【解决方案1】:
    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
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多