[Swift] Storyboardを使わずコードで、LaunchScreen後の遷移先を指定する方法

  • 4
    Like
  • 0
    Comment
More than 1 year has passed since last update.

今回はLaunchScreen後にMainTableViewController.swiftに遷移して欲しい場合のメモです。

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


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

        let rootViewController = MainTableViewController()

        self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
        self.window?.rootViewController = rootViewController
        self.window?.makeKeyAndVisible()

        return true
    }