App Delegate

Hello, I have recently upgraded to Xcode 12 and created a new project. In Xcode 11 there was a file called AppDelegate.swift. I am wondering if this file has been moved, removed, or renamed.

Thank You
In iOS 14 (+ iPadOS 14, Big Sur etc), we have a new way of defining the entry point to our SwiftUI app that negates the need for AppDelegate.

https://developer.apple.com/documentation/swiftui/app

If however you need some of the functionality that was provided by AppDelegate (i.e. instantiating something at launch), you can attach a UIApplicationDelegate class with @UIApplicationDelegateAdaptor .

For example, if we wanted to configure Firebase at launch:
Code Block swift
import SwiftUI
import Firebase
@main
struct ourApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
class AppDelegate: NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        FirebaseApp.configure()
        
        return true
    }
}


App Delegate
 
 
Q