Below is the code which draws the Arc from M_PI/2
to M_PI
.
CGContextRef contet=UIGraphicsGetCurrentContext();
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddArc(path, NULL, CGRectGetMidX(rect), CGRectGetMidY(rect), CGRectGetMidX(rect), M_PI/2.0,M_PI, YES);
CGContextAddPath(contet, path);
CGContextSetStrokeColorWithColor(contet, [UIColor redColor].CGColor);
CGContextStrokePath(content);
Below is the drawing of the above code.
I was expecting it to draw it in the empty or missing part , as its clockwise. I referred to this answer Why does giving addArcWithCenter a startAngle of 0 degrees make it start at 90 degrees? but, I don't know where I am wrong.