The app delegate must implement the window property if it wants to use a main storyboard file swift

后端 未结 10 1729
臣服心动
臣服心动 2020-12-07 17:27

I have just developed an app, but when running in the simulator the debugger console says:

The app delegate must implement the window property if it w

10条回答
  •  无人及你
    2020-12-07 18:12

    I had the same issue, just add var window: UIWindow? as the debug error says.

    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
    
        var window: UIWindow?
    
        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
            // Override point for customization after application launch.
            return true
        }
    

提交回复
热议问题