The State variable that is used for the stiffness.
@State private var stiffnessAmount: CGFloat = 1
The Slider here sets the value, range, and step size.
Slider(value: $stiffnessAmount, in: 1...10, step: 1)
Text with modifier for the animation doesn't change its stiffnessAmount even though the Slider above:
Text("Look here!")
.animation(
Animation.interpolatingSpring(stiffness: Double(stiffnessAmount), damping: 0)
.repeatCount(Int(animationCount), autoreverses: false)
)
I changed the value using the Slider during runtime and then animation stiffness doesn't change.
Why is it not working?