I putted .overlay(Text("Hello, world!")) before .rotation3DEffect(self.flipped1 ? Angle(degrees: 180): Angle(degrees: 0), axis: (x: CGFloat(0), y: CGFloat(10), z: CGFloat(0))), so this is my syntax now:
RoundedRectangle(cornerRadius: 20)
.frame(width: 140, height: 170)
.foregroundColor(self.flipped1 ? .yellow : .purple)
.padding()
.overlay(Text("Hello, world!"))
.rotation3DEffect(self.flipped1 ? Angle(degrees: 180): Angle(degrees: 0), axis: (x: CGFloat(0), y: CGFloat(10), z: CGFloat(0)))
.animation(.default)
.onTapGesture {
self.flipped1.toggle()
}
I want the rectangle to show the text only on one face (only when it is flipped)... Instead now he shows it on all 2 faces