Another thing, when I call print(GCMouse.mice()) inside the immersive space, it returns an empty array which is incorrect.
I threw another print at the ToggleImmersiveSpace button before the call to openImmersiveSpace, and it shows an empty array when the button is pressed, and then at the second print statement (the same one from before that is still inside the RealityView body closure) it correctly shows that their is a mouse connected. Also the onDisappear is able to run correctly.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: