rotation3DEffect causing opacity using Button with trailing closure.

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


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()
    }
}




Answered by workingdogintokyo in 644905022
Using Xcode 12.2 beta-4, your code works without problems for me, on macos 11 and ios 14.2 devices.
Maybe I'm missing something or not understanding the question, but I cannot see where in your code you change the opacity of the Button.

I'm not changing the opacity, that's why it being opaque is my issue.
When a button is tapped, it automatically dims (becomes opaque) until the tap is released. In my (red circle) example, after releasing the tap it is remaining dim/opaque. For the blue square in my example, the text itself does this dimming/undimming when tapped and released.
Accepted Answer
Using Xcode 12.2 beta-4, your code works without problems for me, on macos 11 and ios 14.2 devices.
I downloaded the latest Xcode beta 12.2 and ran with iOS14.2 simulator and don't see the issue.
Thanks for checking.
rotation3DEffect causing opacity using Button with trailing closure.
 
 
Q