StoryBoardを使わない方法 at Swift
上記の記事をSwiftでやりました、というお話です。
import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. // refs. http://qiita.com/shou1471/items/637f7500698c3c5b0bc0 // UIWindowの生成 self.window = UIWindow.init(frame: UIScreen.mainScreen().bounds) self.window?.backgroundColor = UIColor.greenColor() // Storyboardで作成したwindowは通常白背景なので区別するため // 最初に表示されるViewControllerを生成 let viewController = ViewController() self.window?.rootViewController = viewController self.window?.makeKeyAndVisible() return true }