CAShapeLayer strokeStart and strokeEnd positions

三世轮回 提交于 2019-12-04 07:43:56

You can create the path like this

let bezierPath = UIBezierPath(arcCenter:CGPointMake(100,100), radius:40, startAngle: CGFloat(M_PI_2) * 3.0, endAngle:CGFloat(M_PI_2) * 3.0 + CGFloat(M_PI) * 2.0, clockwise: true)

SceenShot

I think subtracting 90 * M_PI / 180 from your original startAngle and endAngle is enough for this task.

God knows why Apple decides to treat 90 degree as the top.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!