Hello.
I am having a problem with the Swift UI window appearing the next time I launch the app after launching Poly Spatial’s Swift UI.
Does anyone know of a solution?

Unity 2022.3.27f1
PolySpatial 1.2.3
Hello.
I am having a problem with the Swift UI window appearing the next time I launch the app after launching Poly Spatial’s Swift UI.
Does anyone know of a solution?

Unity 2022.3.27f1
PolySpatial 1.2.3
Even stranger, after restarting the Simulator or Device, when I launch the app again, the Swift UI window for “Meshing demo” appears.
This window shows up as Bounded volume.
This continues until I force close the app.

I’ve seen this behavior before on my side but am also not 100% sure what is causing it. I think it’s related to not properly managing the swiftUI windows and something on the native side opening (or keeping open) the window when it shouldn’t.
If you are able to come up with some good repo steps that would help. I’ve tried a few times but it hasn’t been consistent.
Thank you for your response.
The steps to reproduce are as shown in the video:
After this, even if you restart the simulator or device, the SwiftUI Window will appear every time the app is launched.
This issue reproduces 100% of the time on our side.
Thank you for your attention to this matter.
@DanMillerU3D
My project is also 100% present, when opening swiftUI, exit the application and re-enter the application, only swiftUI, is there any solution
Just following up. There are a couple solutions floating around in other threads but the gist of it is you need to force close the SwiftUI window when you close the main app (volume).
You can do this by getting callbacks from the Volume Camera for the Volume events like this and having a reference to the SwiftUI Driver script. In this case the force close is just calling the CloseSwiftUIWindow("HelloWorld")
{
m_VolumeCamera.OnWindowEvent.AddListener(OnWindowEvent);
}
void OnDisable()
{
m_VolumeCamera.OnWindowEvent.RemoveListener(OnWindowEvent);
}
void OnWindowEvent(VolumeCamera.WindowState state)
{
if (state.WindowEvent == VolumeCamera.WindowEvent.Closed)
{
m_SwiftDriver.ForceCloseSwiftUIWindow();
}
}
This should force close the left over swiftUI window and the normal app content should re-appear when you open the app / scene again. I’ll try and get this update / fix into the package samples before the next release.
Let me know if you have any more questions.
Thanks for the reply.
I have tested it and confirmed that it improves.
I am pleased to hear that the sample will be fixed in the next release.