0

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.

  • 3
    Does this answer your question https://stackoverflow.com/a/62538373/12299030? – Asperi Jan 14 '21 at 13:11
  • 1
    Does this answer your question? [SwiftUI app life cycle iOS14 where to put AppDelegate code?](https://stackoverflow.com/questions/62538110/swiftui-app-life-cycle-ios14-where-to-put-appdelegate-code) – pawello2222 Jan 14 '21 at 14:54

1 Answers1

1

You can create new file and provide root view like this:

import SwiftUI
@main
struct YourAppName: App {
    var body: some Scene {
        WindowGroup {
            ContentView() <- root page
        }
    }
}
Steve Madsen
  • 13,465
  • 4
  • 49
  • 67
SwiftyLifestyle
  • 416
  • 5
  • 17