You will not do animateWithDuration because it creates key frames for you and what you do with the variables that you pass to the draw method generated by PaintCode.
You want to implement a custom UIView. Create a property for a custom class that contains the variable value for the parameter that your drawing method accepts. Overwrite drawRect to call the DrawKit draw method and pass in a local variable that contains the value for the variable.
You will then use NSTimer to iterate over time, updating the custom UIView property with each iteration. The trick is that when the property is updated, you need to call self.setNeedsDisplay (swift) or [self setNeedsDisplay:YES]; (obj-c).
There is a wonderful blog entry here: https://medium.com/a-first-project-with-paintcode/animating-the-arrow-6e61104b321b
source share