以下代码创建一个红色的270度环形。
我该如何使用Swift 3制作路径绘制动画?谢谢。
let result = Measurement(value: 270, unit: UnitAngle.degrees)
.converted(to: .radians).value
let circlePath = UIBezierPath(arcCenter: CGPoint(x: 200,y: 200), radius: CGFloat(90), startAngle: CGFloat(0), endAngle:CGFloat(result), clockwise: true)
let shapeLayer = CAShapeLayer()
shapeLayer.path = circlePath.cgPath
//change the fill color
shapeLayer.fillColor = UIColor.clear.cgColor
//you can change the stroke color
shapeLayer.strokeColor = UIColor.red.cgColor
//you can change the line width
shapeLayer.lineWidth = 30.0
view.layer.addSublayer(shapeLayer)
我该如何使用Swift 3制作路径绘制动画?谢谢。