UIBezierPath, CABasicAnimation and Swift


Target of this post is to create an easy-to-use progress indicator class written in Swift 4.0.


In this post we need to define a set of actors in order to make it clear how to write the best API.


  1. End user – part of code that creates / calls API
  2. Developer – we write the actual code, so we call ourselves like this
  3. Supporter – person / AI that is going to support the code after we’re done


Required features are limited to the following:

  1. Create different shapes to be animated
  2. Create different animation direction / paths
  3. Set animation duration
  4. Animation control (pause/resume/manual)
  5. Change animation duration “on-the-fly”


  1. Progress Indicator v1


One thought on “UIBezierPath, CABasicAnimation and Swift

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s