How can I start UIBezierPath animation from the top of a circle?

When you draw a circle by using core animation , you might use CAShapeLayer and UIBezierPath to draw it.

UIBezierPath(arcCenter:, radius: view.bounds.width / 2, startAngle: startAngle, endAngle: endAngle, clockwise: true).CGPath

The code above there are startAngle and endAngle parameters which affect where your animation start and end. So if you want to draw the circle from a specific position to another position, I recommend this link.

If you want to start from the top of the circle , your startAngle should be M_PI + M_PI_2.

Leave a Reply