visionOS: your first app for Apple Vision Pro
Windows, volumes and immersive spaces: how visionOS thinks, and how your SwiftUI app reaches Apple Vision Pro with little effort.
Apple Vision Pro looks like a whole new world at first. For SwiftUI developers, though, it's surprisingly familiar: visionOS apps are made of the same views, stacks and lists as on the iPhone. What's new is mainly the space they appear in.
Three kinds of scenes
- Windows: a flat surface in space, like a floating iPad. Most app interfaces live here, with WindowGroup as usual.
- Volumes: a three-dimensional box for objects you can view from all sides. You create one with the volumetric window style.
- Immersive spaces: content all around the user, from a few objects in the room to a whole environment. That's what ImmersiveSpace is for.
@main
struct SpaceApp: App {
var body: some Scene {
WindowGroup { ContentView() }
ImmersiveSpace(id: "Gallery") {
RealityView { content in
let sphere = ModelEntity(mesh: .generateSphere(radius: 0.2))
sphere.position = [0, 1.5, -1]
content.add(sphere)
}
}
}
}Interacting with eyes and hands
Users look at an element and tap thumb and index finger together. For that to work, controls need enough area, at least about 60 points, and a visible hover effect. SwiftUI's standard controls come with both. For custom elements the hoverEffect modifier helps. Put important tools in an ornament at the edge of the window instead of squeezing them into it.
The quickest start
Many iPad apps run unchanged as “Designed for iPad” on Vision Pro. That's a good test, but no substitute for a real visionOS version. My advice: add the visionOS destination to your existing SwiftUI project and see what works right away. Windows with lists and forms usually work straight off, including the glass background.
What's really worth it
- Use space when it adds something: 3D only where it's clearer or more beautiful. A journal doesn't need outer space.
- Comfort first: content at a pleasant distance, nothing that moves unprompted.
- Reality Composer Pro: for 3D scenes and materials, Apple's tool in Xcode is the easiest route.
visionOS is still a small platform, but one with very curious users. Learning to think in spaces today sets you up well for the years ahead. Shared SwiftUI foundations help, as shown in @Observable in SwiftUI.