user979331 user979331 - 1 month ago 5
Swift Question

No '/' candidates produce the expected contextual result type 'CGPoint' - Swift 3

I just change my CGContextAddArc to addArc and now I am getting this error:

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


Here is the code:

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)


what adjustments to I need to make to get this to work?

Answer

You're just passing in a CGFloat, center is expecting a CGPoint

e.g.

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