Create Circle Path in Objective-c using UIBezierPath
In this post, I’ll quickly illustrate how to create a circle/arc path in objective-c.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// pi is approximately equal to 3.14159265359. #define DEGREES_TO_RADIANS(degrees) ((pi * degrees)/ 180) - (UIBezierPath *)createArcPath{ UIBezierPath *aPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(150, 150) radius:75 startAngle:0 endAngle:DEGREES_TO_RADIANS(135) clockwise:YES]; return aPath; } |