I have made an arc like below. By specifying the Radius, Start angle, End angle
CGContextAddArc(ctx, self.frame.size.width/2 , self.frame.size.height/2,
self.radius, 2*M_PI, 3*M_PI/2-ToRad(angle), 0);
Now i want to make the corner of arch rounded. So need of drawing circles on the both ends. Because I'm using frame dimensions giving constants wont work.
You can set it easily by
Objective-C
CGContextSetLineCap(context, kCGLineCapRound);
Swift
context?.setLineCap(.round)
context?.addArc(center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: true/false)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With