Can I attach a RealityKit object to a SwiftUI view?

Asked on 06/12/2025

1 search

Yes, you can attach a RealityKit object to a SwiftUI view. In VisionOS 26, Apple introduced new SwiftUI RealityKit components that enable this integration. The View Attachment component allows you to add SwiftUI views directly to RealityKit entities. This means you can declare your UI inline with the rest of your RealityKit code, making it possible to add SwiftUI views to your 3D scenes as components. This integration is designed to make RealityKit entities responsive to gestures and capable of presenting SwiftUI views like popovers from within your RealityKit scene.

For more details, you can refer to the session Better together: SwiftUI and RealityKit (15:35).

Can I attach a RealityKit object to a SwiftUI view? | Ask WWDC