Skip to content
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

Adding custom phase length options for WiggleRate and ShakeRate #62

Merged
merged 2 commits into from
May 19, 2024

Conversation

mergesort
Copy link
Collaborator

This addresses #30, and adds the same functionality for ShakeRate.

@0xifarouk
Copy link

@robb any thoughts?

@mergesort
Copy link
Collaborator Author

Oh sorry, I'm actually the maintainer of Pow now but I've haven't gotten around to merging it in because I've been testing it in my own app before making an official release. 😅

I'll probably merge it in over the next week or two, but if you need it sooner let me know!

@0xifarouk
Copy link

@mergesort No worries take your time.
I tried it locally but it didn't give me the desired outcome I wanted.
If there is a way to wiggle less (lower the wiggle rotation angle) so it wiggles very very gently.

@mergesort
Copy link
Collaborator Author

Would you be able to show me the code you've tried to slow things down? When it comes to how the animation looks,, wiggle rate and the animation speed/timing.

In my case I was looking to speed up my animation, and was able to do so by lowering the phase length and increasing the animation timing. This is just an example, but you should be able to tweak the numbers and see if it works for you.

.changeEffect(
    .shake(rate: .phaseLength(0.2)),
    value: self.saveState,
    isEnabled: self.saveState == .error
)
.animation(.easeInOut(duration: 0.15), value: self.saveState)

Let me know if that works!

@mergesort mergesort merged commit 5ac7140 into EmergeTools:main May 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants