In Xcode 16 beta 6, we want to start the app with an Alert advising the user that they are about to enter an immersive space.
To achieve this, I use an empty VStack (lets name it View1) with an alert modifier. Then, in the alert’s OK button action, we have the statement openWindow(id: "ContentView”)
. View1 is in the first WindowGroup in the App file.
When pressing OK, the Alert and View1 dismiss themselves, then ContentView displays itself shifted vertically towards the top. ContentView is in a secondary WindowGroup. We should expect ContentView
to display itself front and center to the user as every other window.
What is wrong my code? Or, is there a bug in visionOS?
Attached are images of my code, and a video illustrating the bad behavior.
Apple replied to my FB15058216 with a link to the pushWindow documentation that says : "Calling this action from a pushed window is not allowed.". So, we can't use pushWindow twice as to create deep view hierarchies.
Closing this issue as solved.