We spend a lot of time looking at heart icons but not thinking about the organ they represent. I've had my life saved by a defibrillator and I now have one with me at all times in the form of a pacemaker. I thought it would be a nice to use a defib to bring a heart animation to life.
Submission for SwiftUISeries - Animations
- All values are linked to a single size value so it can easily be resized.
- I created an enum called Keyframe and cycled through the values to trigger each key of the animation in sequence. The delay parameter ensures each keyframe is appropriately staggered.
- The beating heart at the end was a bit tricky and required a local .animation modifier to override the other animations.
- The shapes are each drawn separately with some help from package I made called: