-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConditionalEffect doesn't stop immediately when condition becomes false #65
Comments
Hey @davidpasztor, I took a look at the code and the way that the wiggle animation works is that it creates a TimelineView to run a simulation of a 3D transform that moves the icon left and right. I haven't quite deciphered how to achieve the effect you're looking for, especially because it appears that using a if isConditionalEffect {
wiggleCount += 4
} I may take a look at this in the future but don't have it on my immediate radar. That said, if you would like to contribute I will gladly accept pull requests that create a new parameter that can stop the shaking on demand, I can imagine that it would be useful to others not just yourself! Sorry I don't have a better answer, I'm still getting familiar with the library well enough to make changes to the physics portion, beyond just maintaining the APIs. |
@mergesort thanks for the update, that is valuable information! I'll see if I can find a way to fix the issue myself, but I'm not that familiar with the physics involved of such effect, so not sure if I'll succeed in a reasonable timeframe.
The thing that confused me was that the |
I want to mimic the edit mode of the iOS Home Screen, where cells wiggle while in edit mode and stop wiggling as soon as the user exits edit mode.
I've tried using
.conditionalEffect(.repeat(.wiggle, every: .seconds(0.1)), condition: shouldWiggle)
, but when the condition becomesfalse
, the effect doesn't stop immediately.Here's a minimum, reproducible example showcasing the issue:
Screen recording of the problem:
The text was updated successfully, but these errors were encountered: