不是' /'候选人产生预期的上下文结果类型' CGPoint' - 斯威夫特3

时间:2016-10-19 14:59:00

标签: swift swift3

我只是将我的CGContextAddArc更改为addArc,现在我收到此错误:

No '/' candidates produce the expected contextual result type 'CGPoint'

以下是代码:

context?.addArc(center: (frame.size.width)/2, radius: frame.size.height/2, startAngle: (frame.size.width - 10)/2, endAngle: CGFloat(M_PI * 2.0), clockwise: 1)

我需要做些什么调整才能让它发挥作用?

1 个答案:

答案 0 :(得分:2)

您只是传递CGFloatcenter期待CGPoint

e.g。

context?.addArc(center: CGPoint(x: frame.size.width/2, y: frame.size.height/2) ...