XCode error - The app delegate must implement the window property

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

Stackoverflow - Issue

If you are not using SwiftUI, Here are the steps, I have followed.

  1. Deleted Application Scene Manifest entry from Info.plist
  2. Deleted SceneDelegate.swift file
  3. Deleted all scene related methods in AppDelegate.swift class
  4. added var window: UIWindow? property in AppDelegate.swift class

After these steps, your AppDelegate.swift file should look something like the following.

import UIKit

@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
    }
}