Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.14 KB

PREPARE_IOS_PROJECT.md

File metadata and controls

39 lines (27 loc) · 1.14 KB

Prepare your iOS Project

  1. Delete Main.storyboard and remove its reference from Info.plist
  2. Remove the entire block Application Scene Manifest from Info.plist and delete the file SceneDelegate.swift.
  3. 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
    }
}
  1. Create a main.swift file:
// main.swift

import UIKit
import func Foundation.NSStringFromClass

_ = UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self))