Post

Replies

Boosts

Views

Activity

Reply to Not receive onDisappear event on the first WindowGroup
The accepted answer works, but it seems like the view does not really get de-initialized, leading to memory leaks. There is a workaround to listen to the scenePhase changes as suggested and call dismissWindow(id: "Your-Window-Id"). Then onDisappear will be called as well and the view is de-initialized correctly. .onDisappear { // ... } .onChange(of: scenePhase) { oldValue, newValue in if newValue == .background { dismissWindow(id: "Your-Window-Id") } } Is there already a feedback for this or a fix planned @Vision Pro Engineer? Even though the workaround works, it still seems a bit odd.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to Hidden window/volume system overlays in Full Space
I found a way how you can reproduce it, for a new project with "Immersive Environment App", you just have to set UIImmersionStyleFull for UISceneInitialImmersionStyle in the info.plist file. And in the app file you can use the following code, the only changes are that the immersion style gets changed to .mixed and that the window gets opened once the immersive space shows up. When you then move back in the simulator, the handles are hidden at some point: import SwiftUI @main struct SkySphereTestApp: App { @State private var appModel = AppModel() @State private var avPlayerViewModel = AVPlayerViewModel() @Environment(\.openWindow) var openWindow var body: some Scene { WindowGroup(id: "Window") { if avPlayerViewModel.isPlaying { AVPlayerView(viewModel: avPlayerViewModel) } else { ContentView() .environment(appModel) } } ImmersiveSpace(id: appModel.immersiveSpaceID) { ImmersiveView() .environment(appModel) .onAppear { appModel.immersiveSpaceState = .open avPlayerViewModel.play() openWindow(id: "Window") } .onDisappear { appModel.immersiveSpaceState = .closed avPlayerViewModel.reset() } } .immersionStyle(selection: .constant(.mixed), in: .mixed) } } For the Artists scene example you also have to change the info.plist settings and set the immersionStyle to .mixed. Then, in the ImmersiveView file just add a sphere that would act like a sky sphere RealityView { content in // Add the initial RealityKit content. if let immersiveContentEntity = try? await Entity(named: "ArtistWorkflowExample", in: realityKitContentBundle) { content.add(immersiveContentEntity) } var material = SimpleMaterial(color: .blue, isMetallic: false) material.faceCulling = .front let skybox = ModelEntity(mesh: .generateSphere(radius: 500), materials: [material]) content.add(skybox) }
Topic: Spatial Computing SubTopic: General Tags:
Mar ’25
Reply to Hidden window/volume system overlays in Full Space
You are right, for those two examples it also worked for me. I tried both domes in my app: The handles were still hidden. But I just found out if I use .immersionStyle(selection: .constant(.full), in: .full) with UIImmersionStyleFull for UISceneInitialImmersionStyle, it suddenly works. So it seems they are hidden with everything set to .mixed - but again, in the examples you mentioned, everything still works with .mixed as well. The other project where I know, that this issues appears, is a Unity PolySpatial build.
Topic: Spatial Computing SubTopic: General Tags:
Mar ’25
Reply to VisionOS - Enhancing Accessibility for Individuals with Visual Impairments
Hello there, I just stumbled upon your post while looking how I can improve my visionOS app's accessibility. Unfortunately it's just a small card matching game, so it won't help you much, but it's fully accessible and I just tried it again with VoiceOver on the Vision Pro and saw, that it's not possible to jump to the Immersive Content once it's in Full Space. Not sure if it's a bug from Apple or on my side, but I have to fix it. In case you are interested to give it a try, it's called Ploppy Pairs and is available on all Apple platforms except the Apple Watch. (Link: https://apps.apple.com/developer/michael-temper/id1676934134) Anyway, sorry for drifting away haha, it's always very interesting to read about the experiences of visually impaired people to get a feeling of how we as developers can help to make our apps better for everyone, so thanks for sharing your thoughts! Do you actually have a Vision Pro? Because for your impairment I was wondering if you heard about the app Magic Room? (Link: https://apps.apple.com/us/app/magic-room-lidar-environment/id6477834941) I never tried it myself as it costs around 18$, but I think it uses environment tracking to put overlays onto your real surroundings. Maybe this can help you seeing your surroundings better in the dark! The developer is also quite active on X (Link: https://x.com/wenbq_me), so I guess he also responds to feature requests if you have any! Best Regards, Michael
Dec ’24