How do I detect when the user dismisses an ImmersiveSpace that uses CompositorServices to render with Metal

I want my app to know that the immersive space is no longer open, so that other UI can be updated accordingly.

I have tried using ‘.onChange(of: scenePhase)’ on the ‘ImmersiveSpace’ to detect changes to the ScenePhase passed in via the environment. I expected this to reflect the State of the immersive space itself, but it does not. Eg. it seems this is equal to .background or .active etc. dependent on other scenes in the app, not the immersive space itself.

Upvotes: 0

Views: 31

Answers (0)

Related Questions