swift 没有故事板的iOS项目。 AppDelegate.swift

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swift 没有故事板的iOS项目。 AppDelegate.swift相关的知识,希望对你有一定的参考价值。

/*
1. Delete `main.storyboard`
2. Emptify `Main Interface` on the project's general page
3. Add below code inside `application:didFinishLaunchingWithOptions`
*/
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
        self.window = UIWindow(frame: UIScreen.main.bounds)
        if let window = self.window {
            let viewController = ViewController()
            window.rootViewController = viewController
            window.backgroundColor = UIColor.white
            window.makeKeyAndVisible()
        }
        
        return true
    }
.
.
.

以上是关于swift 没有故事板的iOS项目。 AppDelegate.swift的主要内容,如果未能解决你的问题,请参考以下文章