うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

最初に選択されるTabを指定する方法

English here uchinoinu.hatenablog.jp

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        let tabBar = self.window!.rootViewController as! UITabBarController
        tabBar.selectedIndex = 1 // ここを指定したいTabのIndexにする

        return true
    }