What is the entry point in my app created using newest Xcode?

Asked on 2025-01-10

1 search

The entry point for your app created using the newest Xcode depends on whether you are using SwiftUI or UIKit.

For SwiftUI apps, the entry point is typically defined by a @main struct that conforms to the App protocol. This struct contains a body property that defines the app's scenes, which are the building blocks of the app's user interface. You can start by creating a new SwiftUI app in Xcode and defining your app's structure using scenes like WindowGroup.

For UIKit apps, the entry point is usually the AppDelegate class, which conforms to the UIApplicationDelegate protocol. The AppDelegate is responsible for handling app lifecycle events. In the context of document-based apps, you can make the UIDocumentViewController the root view controller and apply your customizations to the launch options, as mentioned in the session Evolve your document launch experience.

If you are interested in learning more about SwiftUI essentials, you can refer to the session SwiftUI essentials.