I have an immersive space
ImmersiveSpace(id: "FlappyImmersiveSpace") {
FlappySpace()
}
On this immersive space, I want to add a gesture recognizer, so that no matter where you are looking in the immersive space, I can detect a pinch.
ImmersiveSpace(id: "FlappyImmersiveSpace") {
FlappySpace()
.gesture(
TapGesture()
.onEnded({ _ in
print("TAPPED")
})
)
}
This doesn't work.
struct FlappySpace: View {
var body: some View {
RealityView { content in
// Add content
}
.gesture(
TapGesture()
.onEnded({ _ in
print("TAPPED")
})
)
}
}
Neither does this.
Does any one know how to detect gestures in an immersive space, the gesture can not be specific to an entity in the space, but any where in the entire space.
2
0
1.5k