SwiftUI 3.0 Water Drop Wave Form - Animation Challenge - Xcode 13 - SwiftUI Tutorials
Added 2022-02-11 22:44:50 +0000 UTC
Source Code For SwiftUI 3.0 Water Drop Wave Form - Animation Challenge - Xcode 13 - SwiftUI Tutorials.
Download Code ๐
Comments
This is a great tip but I don't think gets to the heart of the problem and may not work unless others have the exact same device width you do.
I'm still investigating but I believe unless your geometry reader width is set to 360 (which is what rect.width is) then the sin animation won't quite work. After stipulating the frame of the GeometryReader to 360 I have removed all jitters from my animation
In order to get your wave to match the width of your mask or container (I am not masking mine within a water drop and want it full screen width) simply use a scaleEffect to then scale it out wider (thanks Kavsoft for showing this simple lib function)
2022-09-01 19:57:53 +0000 UTC
Hey! On a physical device, the wave animation jumps a bit when it reaches the end of the cycle and beings the repeat. Is there a way to fix this?
It's weird because the animation is smooth on the simulator
Edit: adding - 25 seems to do the trip..
startAnimation = size.width - 25