Anchoring a view in VisionOS

Hi community,

I'm developing a VisionOS app where I want to anchor a View so that it follows users' movement. The View contains clickable Buttons.

However I'm been looking through docs/wikis and it seems currently, we can only anchor an Entity instance.

Any ideas about how I can anchor a view?

References:

This implementation is achieved by setting the view as an attachment of Entity. The way it is written may have changed depending on the version of Xcode beta, but I believe the same approach can be used.

https://github.com/satoshi0212/visionOS_30Days/blob/main/Day28/Day28/View/ImmersiveView.swift

Anchoring a view in VisionOS
 
 
Q