Pow icon indicating copy to clipboard operation
Pow copied to clipboard

Adding custom phase length options for WiggleRate and ShakeRate

Open mergesort opened this issue 1 year ago • 4 comments

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

mergesort avatar Mar 25 '24 14:03 mergesort

@robb any thoughts?

0xifarouk avatar Apr 11 '24 16:04 0xifarouk

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!

mergesort avatar Apr 11 '24 18:04 mergesort

@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.

0xifarouk avatar Apr 11 '24 23:04 0xifarouk

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 avatar Apr 12 '24 00:04 mergesort