How to open multiple windows and volumes in VisionOS

Oscar de la Hera Gomez
A flower that represents VisionOS with the text “Open Multiple Windows & Volumes” beneath it.

To open multiple windows or volumes, add the volumes and windows with unique identifiers to the app and use the openWindow environment variable within a button.

The code for this tutorial can be found in the repository linked below on the 101/opening-multiple-windows branch.

Please note that this tutorial demonstrates that you can open multiple versions of the same window and volume, as long as they are present in the app with an associated identifier.

Step One: Create the Identifiers

A screenshot of XCode showing how we created identifiers in a struct using UUIDs.

Windows and Volumes require identifiers to be able to be opened in VisionOS.

Step Two: Create the Entities

A screenshot of XCode showing the sample window and volume that we created.

Create new files for the windows and volumes.

Step Three: Add to the App

A screenshot of XCode showing how we added the windows and volumes to the VisionOS app.

Add the entities created in step two to the app.

Step Four: Update the Main Window

A screenshot of XCode showing how we updated the main window to use the openWindow environment variable and how its used to open windows and volumes through buttons found on the window.

Add the openWindow environment variable to the main window.

Then use a button to open the window or volume but calling the environment variable along with the identifier.

Step Five: Test

A screenshot of the simulator showing multiple windows and volumes.

Run the app and confirm that everything works as expected.

Looking to learn more about VisionOS, Spatial Computing, Design and Technology?

Search our blog to learn more about visionOS, spatial computing, design and technology.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details