Hello everyone,
I would like to a flip animation, so that when I press on the rectangle it will flip to other side (like in a cards game)
How can I do that?
Thank you
Here's my code:
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
var body: some View {
Group {
Button {
} label: {
Rectangle()
.frame(width: 140, height: 170)
.foregroundColor(Color(.systemTeal))
.cornerRadius(20)
}
}
}
}
PlaygroundPage.current.setLiveView(ContentView())