SwiftUI-lifecyle and app properties

In a SwiftUI-lifecyle App I have two (viewless-)controllers that are owned by the App-struct itself.

Within an app with a delegate-based-lifecyle I would have used 'NSApplication.shared.delegate' to get acces to the App (and the two properties in it).

How do I accomplish the same with a SwiftUI-lifecyle?

that are owned by the App-struct itself.

Pass them with environmentObject or as parameters of the root View.
Or else, make them independent from App, singleton may be one way.

You should better not think App could be used the same with AppDelegate.


SwiftUI-lifecyle and app properties
 
 
Q