|
Hi, I want to change parameter of the animation while the animation is running. But if I change the parameter, the change is ignored until the animation stopped. The goal with this UI:
Whats wrong? What do I need to change change to reach the goal? thank you for your ideas & help. Here is the source:
|
|
Hi, If you want the square to move back to the starting position you need to change the offset again, so in the stop button action you need to set isAnimatting to false. |
|
Hi, I dont want it back tothe start point. This is not the problem. I want the blue rectangle to reach the endpoint immediately after clicking 'stop'. If you dont click 'stop' it needs 5 sec to reach the endpoint. Thats okay. But if I click 'stop' one or two seconds after the start, it has to reach the endpoint immediately. The oscillation has to stop. |
|
If you read the documentation for I have made some modifications to your code to help illustrate this. You want I don't think that it is possible achieve what you want using Add these changes to illustrate the animations. New @State variable
Change to the Rectangle
Changes to he HStack Buttons
|
|
Hi, youre right, there is no official way to do this. I used a trick to get it solved: Manual fire the trigger for the next animation in the event of button-press. Thanks for the help. Ciao |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.