There is no Scene and App delegate in swift ui.

It seems there is no scene delegate in the latest swift ui version. Can anyone help me set my root page of my application please?

Thank you from now on.
Answered by cnnsyhan02 in 656864022
I found the solution guys. Just add the SwiftUI file name right under I mean in the first place of WindowGroup.
Have a nice time coding !


Code Block import SwiftUI
@main
struct LandmarkBookSwiftUIApp: App {
    var body: some Scene {
        WindowGroup {
           //add the name of the first view you want to show.
        }
    }
}


It seems there is no scene delegate in the latest swift ui version.

Do you mean some app template created by Xcode 12?
Please check what you have chosen for Interface and Life Cycle when creating a project.
I already created the project. How can I change it do you have any idea ?
Accepted Answer
I found the solution guys. Just add the SwiftUI file name right under I mean in the first place of WindowGroup.
Have a nice time coding !


Code Block import SwiftUI
@main
struct LandmarkBookSwiftUIApp: App {
    var body: some Scene {
        WindowGroup {
           //add the name of the first view you want to show.
        }
    }
}


There is no Scene and App delegate in swift ui.
 
 
Q