In this code
for (int i=0;i<3;i++) {
CGContextAddLineToPoint(context, self.xShift+15+self.rectLen*self.width+self.rectLen*(i+1), self.yShift+self.rectLen*
setFill isn't for Core Graphics drawing but for drawing like [myUIBezierPath fill];
Instead set the fill color and stroke color using:
CGContextSetFillColorWithColor(context, [[UIColor cyanColor] CGColor]);
CGContextSetStrokeColorWithColor(context, [[UIColor blackColor] CGColor]);
Also, the following line:
CGContextDrawPath(context, kCGPathStroke);
Will only stroke the path, since the drawing mode is set to kCGPathStoke. To fill it as well you should replace it with
CGContextDrawPath(context, kCGPathFillStroke);
If your path has holes in it or crosses itself you should use even-odd fill and stroke
CGContextDrawPath(context, kCGPathEOFillStroke);