- Delete
Main.storyboard
and remove its reference from Info.plist
- Remove the entire block
Application Scene Manifest
from Info.plist
and delete the file SceneDelegate.swift
.
- Modify
AppDelegate.swift
:
- Remove the
@UIApplicationMain
attribute and make the AppDelegate
class final
- Initialize
UIWindow
and your initial ViewController
in the application
function
- Remove application delegates related to
UIScene
and UISceneSession
// AppDelegate.swift
// @UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow()
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
return true
}
}
- Create a
main.swift
file:
// main.swift
import UIKit
import func Foundation.NSStringFromClass
_ = UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self))