I'm creating a button and animating when tapped using rotation3DEffect. However, when the button is tapped it remains opaque.
(In my actual code I'm using an image not a circle.)
I'm thinking this is a bug, but my experience with swiftui only began recently. Any thoughts appreciated.
Steve
Xcode 12.1, macOS 10.15.17, target iOS 14.1
(In my actual code I'm using an image not a circle.)
I'm thinking this is a bug, but my experience with swiftui only began recently. Any thoughts appreciated.
Steve
Xcode 12.1, macOS 10.15.17, target iOS 14.1
Code Block import SwiftUI struct ContentView: View { @State private var spinDegrees = 0.0 @State private var spinDegrees2 = 0.0 var body: some View { VStack{ Text("Tap Red Circle") Button(action: { withAnimation(.easeOut(duration: 0.8)) { self.spinDegrees += 360 } }) { Circle() .foregroundColor(.red) .rotation3DEffect( .degrees(spinDegrees), axis: (x: 0.0, y: 1.0, z: 0.0) ) } Button("Tap here too") { withAnimation(.easeOut(duration: 0.8)){ self.spinDegrees2 += 360 } } .background(Color.blue) .foregroundColor(.white) .rotation3DEffect( .degrees(spinDegrees2), axis: (x: 0.0, y: 1.0, z: 0.0) ) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }