Extra line when drawing an arc in swift
I have this kind of code in a swift app and I get an extra greyed line reaching the starting point of the arc. The arc itself is drawn as expected, but it seems like CGContextMoveToPoint is leaving some trace behind before reaching the starting point. override func drawRect(rect: CGRect) { var context:CGContextRef = UIGraphicsGetCurrentContext(); var centerX,centerY,startAngle,endAngle,radius:CGFloat startAngle = CGFloat(M_PI_4) endAngle = -startAngle radius = (rect.height/2) / sin(startAngle) centerX = rect.width/2 + (radius*cos(startAngle)) centerY = rect.height/2 CGContextMoveToPoint