Search code examples
iosuibezierpathcabasicanimationcakeyframeanimation

How can I visually display points in a UIBezierPath?


I'm trying to change the shape of a CAShapeLayer from a circle to a different shape. Looking at this question:

Smooth shape shift animation

I found the solution but my question is how can I visually see how many points a UIBezierPath has. Is there a way to color a point different than the line it produces?

For example,it's simple with a line to understand that there are two point, but if we make a circle with bezierPathWithRoundedRect, does that count as one point or are there more?


Solution

  • You would need to add the circle yourself to visually see the dots. Just keep track of the CGPoints you give to the path and draw a circle around each one.

    Btw.. if you use PaintCode, you can edit the bezier path and see the point -- it's very useful.