I am in the process of developing an application that supports multiple windows and types (such as volumetric, immersive, and window groups). I am using SwiftUI in this implementation of the app. While working on this, I've encountered a peculiar issue. Initially, the application defaults to opening a WindowGroup scene, which serves as the main interface for the app. Subsequently, I've implemented ways for users to open volumetric windows or immersive spaces with the tap of a button. These windows open and close without any issue, and everything functions smoothly for both types of scenes.
However, the problem arises in a specific scenario: when I open a volumetric window, close the main window group, close the volume, and then delete the app. Upon reinstalling the app, it opens into a blank window with only the bottom bar visible. There is also another scenario where if I have only the volumetric window open and then close and update the app, the same issue occurs. The only way to get back to where the app is functional is to force quit the app the in visionOS force quit menu.
Upon consulting the Apple documentation, I've ensured that I'm following the approaches they list there. Despite this, I'm unsure of what I might be doing wrong. Has anyone encountered a similar issue in their app development experience with visionOS?
Below is a sample structure of the main app for reference:
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup(id: "window id") {
MainView()
}
WindowGroup(id: "volumetric id") {
VolumetricView()
}
.windowStyle(.volumetric)
ImmersiveSpace(id: "immersive id", for: Model.self) { $model in
ImmersiveView(model: model)
}
}
}