How's NBA App for VisionOS able to show multiple windows

Hello,

I'm working on a project that intent to present multiple video player for the users of the app, just like how NBA app does. It also has the Split View button at the top, which I'm not sure how the managed to place it beyond the window bounds. I'm not entirely sure if this is all ornament view based views. Any thoughts and ideas here, would be helpful.

Hey there,

You can use attachments in RealityView to get this effect. Take a look at the Diorama sample code - https://developer.apple.com/documentation/visionos/diorama#Create-attachments-for-points-of-interest.

The items at the top are ornaments, you're correct.

The side panels are achieved using ornaments:

.ornament(attachmentAnchor: .scene(.trialing), contentAlignment: .leading) {
    // panel content view
}

Note that setting contentAlignment is crucial to prevent the panel from covering the main content.

How's NBA App for VisionOS able to show multiple windows
 
 
Q