Skip to main content
added 270 characters in body
Source Link
Mojtaba Hosseini
  • 124.3k
  • 45
  • 343
  • 328

Multiplatform

In addition to the answer of Abandoned Cart, Since Xcode 11, You have a new option called Multiplatform for choosing as a starting template. That's where you will only see a file contains:

@main struct MyMultiplatformApp: App { var body: some Scene { WindowGroup { ContentView() } } } 

This is how the system knows where to start the code with @main (in Swift 5.3) and it contains WindowGroup that manages multiple windows of your app in all apple platforms. So you don't need the be worry about SceneDelegate and AppDelegate anymore.

If you need it to be like the old app delegate, for example when you want to use its methods, You should subscribe for corresponding notifications or use the UIAppDelegateAdapter wrapper as I described here

Multiplatform

In addition to the answer of Abandoned Cart, Since Xcode 11, You have a new option called Multiplatform for choosing as a starting template. That's where you will only see a file contains:

@main struct MyMultiplatformApp: App { var body: some Scene { WindowGroup { ContentView() } } } 

This is how the system knows where to start the code with @main (in Swift 5.3) and it contains WindowGroup that manages multiple windows of your app in all apple platforms. So you don't need the be worry about SceneDelegate and AppDelegate anymore.

Multiplatform

In addition to the answer of Abandoned Cart, Since Xcode 11, You have a new option called Multiplatform for choosing as a starting template. That's where you will only see a file contains:

@main struct MyMultiplatformApp: App { var body: some Scene { WindowGroup { ContentView() } } } 

This is how the system knows where to start the code with @main (in Swift 5.3) and it contains WindowGroup that manages multiple windows of your app in all apple platforms. So you don't need the be worry about SceneDelegate and AppDelegate anymore.

If you need it to be like the old app delegate, for example when you want to use its methods, You should subscribe for corresponding notifications or use the UIAppDelegateAdapter wrapper as I described here

Source Link
Mojtaba Hosseini
  • 124.3k
  • 45
  • 343
  • 328

Multiplatform

In addition to the answer of Abandoned Cart, Since Xcode 11, You have a new option called Multiplatform for choosing as a starting template. That's where you will only see a file contains:

@main struct MyMultiplatformApp: App { var body: some Scene { WindowGroup { ContentView() } } } 

This is how the system knows where to start the code with @main (in Swift 5.3) and it contains WindowGroup that manages multiple windows of your app in all apple platforms. So you don't need the be worry about SceneDelegate and AppDelegate anymore.