Why isn't Canvas getting updates on animated @State variables?
For example when I animate the rotationAngle as seen here:
@State private var rotationAngle: Double = 90.0
HStack {
Canvas() {
print(rotationAngle) //prints 90.0 at the start, 0.0 when the animation starts
}
}
.onTapGesture {
withAnimation(.easeIn(duration: 2)) {
rotationAngle = 0.0
}
}
The same animation works fine in any other case at the same time. All views containing reference to the rotationAngle get updated, except Canvas.
Is there any other solution, can I access the value of rotationAngle while it's being animated?