Kurt Höblinger
# Transition from App Delegate to SwiftUI life cycle

Apple introduced the new SwiftUI life cycle some years ago. I still had some apps that used UIKit and the App Delegate life cycle.

Transitioning from one to the other seems trivial at first, makes you scratch your head shortly later only to realise that it actually is quite trivial.

Before you start you should redesign your views in SwiftUI and create a YourSwiftUIView which serves as the first view your users are presented with.

Firstly, remove @UIUIApplicationMain from your AppDelegate class.

Secondly, create a SwiftUI App struct:

import Foundation
import SwiftUI

struct yourAppName: App {
        // Relevant if you use CoreData
    let persistenceController = PersistenceController.shared

    var body: some Scene {
        WindowGroup {
                    // Relevant if you use CoreData
                .environment(\.managedObjectContext, persistenceController.container.viewContext)

Thirdly, remove UIApplicationSupportsMultipleScenes key from your InfoPlist. This key will have quite an entourage. Remove it all.

                <string>Default Configuration</string>

Finally you can remove all the Storyboard Files and accompanying ViewControllers.