How to remove Scene Delegate from iOS Application? How to remove Scene Delegate from iOS Application? ios ios

How to remove Scene Delegate from iOS Application?


You need to do the following steps:

  1. Remove Scene delegate methods from App Delegate and delete the Scene delegate file.
  2. You need to remove UIApplicationSceneManifest from Info.plist.

You also need to add var window:UIWindow? if it is not present in AppDelegate


To add to accepted answer: you also need to write this in your AppDelegate:

 self.window = UIWindow(frame: UIScreen.main.bounds) let controller = MyRootViewController() window?.rootViewController = controller window?.makeKeyAndVisible()


It is a complete solution for empty project generated with Xcode (with storyboard)

  1. Remove SceneDelegate.swift file
  2. Remove Application Scene Manifest from Info.plist file
  3. Paste this code to your AppDelegate.swift file
import UIKit@mainclass AppDelegate: UIResponder, UIApplicationDelegate {    var window:UIWindow?    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {        self.window = UIWindow(frame: UIScreen.main.bounds)        window?.rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()        window?.makeKeyAndVisible()        return true    }}


matomo