Hi, I have a SwiftUI View, that is attached to a 3D object in Reality View. This is supposed to be a HUD for the user to select a few things. I wanted a sub menu for one of the top level buttons.
But looks like none of the reasonable choices like Menu, Sheet or Popover work.
Is there a known limitation of RealityKit Views where full SwiftUI cannot be used? Or am I doing something wrong?
For example,
Button {
SLogger.info("Toggled")
withAnimation {
showHudPositionMenu.toggle()
}
} label: {
HStack {
Image(systemName: "rectangle.3.group")
Text("My Button")
}
}
.popover(isPresented: $showHudPositionMenu, attachmentAnchor: attachmentAnchor) {
HudPositionMenuItems(showHudPositionMenu: $showHudPositionMenu, currentHudPosition: $currentHudPosition)
}
This will print "Toggled" but will not display the MenuItems Popover.
If it makes any difference, this is attached to a child of a head tracked entity.