SwiftUI Shake Animation
Published in
Oct 24, 2022
Here is a quick sample of a shake animation done in SwiftUI with a completion block.
Use Case
The API is simple to use, you just need to call .shake()
on any view while passing a State
variable, and optionally a completion block that is executed once the animation is finished.
Implementation
The full code is the following:
Do you like my content?
Help me keep going with a donation!