Post

Replies

Boosts

Views

Activity

Comment on So... AnimatableModifier is now deprecated, but how to "use Animatable directly"?
to suppress the .offset()'s default animation behavier and make sure the interpolation of the animatable values happens in the RectView, i.e. the set { value = newValue; print("animating \(value)") } will be called and then check for completion of the animation.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Comment on So... AnimatableModifier is now deprecated, but how to "use Animatable directly"?
Sorry, I think I made the mistake of accepting your solution. After a second thought and test, it seems that in your solution, the animation works only because you removed the .animation(nil) and the default modifier .offset() fires the animation under the hood. One testiment is that print("animating \(value)") is not executed.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Comment on SwiftUI opacity animation fails in Gesture's onEnded method
Thanks for your answer! But that doesn't explain why the Button(action:) works as expected, and why the layout is not recalculated if the view is removed.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22