Target
Target of this post is to create an easy-to-use progress indicator class written in Swift 4.0.
Actors
In this post we need to define a set of actors in order to make it clear how to write the best API.
Actors:
- End user – part of code that creates / calls API
- Developer – we write the actual code, so we call ourselves like this
- Supporter – person / AI that is going to support the code after we’re done
API
Required features are limited to the following:
- Create different shapes to be animated
- Create different animation direction / paths
- Set animation duration
- Animation control (pause/resume/manual)
- Change animation duration “on-the-fly”
Contents
References
- https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreAnimation_guide/CoreAnimationBasics/CoreAnimationBasics.html#//apple_ref/doc/uid/TP40004514-CH2-SW12
- http://coveller.com/2016/05/core_animation_timing/
- http://ronnqvi.st/controlling-animation-timing
- https://github.com/mathewsanders/Scrubber
- https://milen.me/writings/core-animation-3d-model/
- https://medium.com/@flyosity/your-spring-animations-are-bad-and-it-s-probably-apple-s-fault-784932e51733
- https://www.objc.io/issues/12-animations/animations-explained/
One thought on “UIBezierPath, CABasicAnimation and Swift”