I’m trying to stroke my path by writing below line of code but its not getting drawn. Please help me to find out whats the problem in this.
void draw1PxStroke(CGContextRef context,CGColorRef color,CGMutablePathRef arcPath) {
CGContextSaveGState(context);
CGContextSetLineCap(context, kCGLineCapSquare);
CGContextSetStrokeColorWithColor(context, color);
CGContextSetLineWidth(context, 3.0);
CGContextAddPath(context, arcPath);
CGContextClip(context);
CGContextStrokePath(context);
CGContextRestoreGState(context);
}
The problem is probably your call to
CGContextClipwhich has the side effect of resetting the context’s current path to an empty path.