Thanks for this suggestion, I'll experiment with it. I will probably end up using my current workaround of handling the optional in the root view and returning an EmptyView if it's nil, because in my actual app (as opposed to the example I shared), the object is somewhat large and has several properties that don't have obvious default values. But the EnvironmentKey approach seems like a good alternative.
Post
Replies
Boosts
Views
Activity
I was able to avoid instantiating the root ContentView by adding an @Environment(.scenePhase) property to the App struct, and then wrapping the ContentView in an "if" block that checked if case .background = scenePhase. However, I wasn't comfortable with this, because I thought it might have unintended consequences when moving from foreground to background. onChange(of: scenePhase) doesn't seem to be called when launching into the background, so I stuck with using optional Environment values.
Yes, I filed a report via Feedback Assistant. The report's ID is FB13524420. It is still open, with no recent similar reports listed. I haven't received any updates from Apple.