SwiftUI: withAnimation in onChange not working

I am trying to create an animation that is triggered by a change in a different value. However, the animation is not working. The view just "pops-up" immediately instead of using it's transition.

Code Block struct ContentView: View {    @State private var count = 0    @State private var isShowing = false    var body: some View {        VStack {            if isShowing {                Text("SHOWING")                    .transition(.scale)            }            Button("Increase") {                count += 1            }        }            .frame(width: 200, height: 200)            .onChange(of: count, perform: { (count) in                withAnimation {                    isShowing.toggle()                }            })    }}


Answered by joosttk in 656071022
Ah yes, I now tried it in a project, and that works as expected. Before I tried it in a Playground, which did not work. So issue solved :)
As far as I tested your code, the Text SHOWING zooms up and down on tap of the button.

Can you explain the condition to reproduce your issue?
Accepted Answer
Ah yes, I now tried it in a project, and that works as expected. Before I tried it in a Playground, which did not work. So issue solved :)
SwiftUI: withAnimation in onChange not working
 
 
Q