LoginSignup
4

More than 5 years have passed since last update.

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

Posted at

今回は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
    }

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4