How do you pin a volume to a tabletop?
Asked on 06/12/2025
1 search
To pin a volume to a tabletop in visionOS, you can use the Surface Snapping feature introduced in VisionOS 26. This feature allows you to snap windows and volumes to physical environments by gently moving the window close to a surface. For volumes, you can snap the bottom to horizontal surfaces like a table. This is achieved using the new SurfaceSnapping Info API, which provides information about the snapping state and allows you to anchor the volume horizontally on the table.
For more detailed information on how to implement this, you can refer to the session Set the scene with SwiftUI in visionOS (08:15) where volumetric enhancements, including surface snapping, are discussed.

Set the scene with SwiftUI in visionOS
Discover exciting new APIs to enhance windows, volumes, and immersive spaces in your visionOS app. Fine tune the behavior of your scenes when relaunched or locked in place. Make volumes adapt to their surroundings with clipping margins and snapping. Stream immersive content from Mac to Vision Pro. Elevate your existing UIKit-based apps with volumes and immersive spaces.

What’s new in SwiftUI
Learn what’s new in SwiftUI to build great apps for any Apple platform. We’ll explore how to give your app a brand new look and feel with Liquid Glass. Discover how to boost performance with framework enhancements and new instruments, and integrate advanced capabilities like web content and rich text editing. We’ll also show you how SwiftUI is expanding to more places, including laying out views in three dimensions.

Dive deep into volumes and immersive spaces
Discover powerful new ways to customize volumes and immersive spaces in visionOS. Learn to fine-tune how volumes resize and respond to people moving around them. Make volumes and immersive spaces interact through the power of coordinate conversions. Find out how to make your app react when people adjust immersion with the Digital Crown, and use a surrounding effect to dynamically customize the passthrough tint in your immersive space experience.