I use the below code for fill path in viewDidLoad
it works perfect
UIGraphicsBeginImageContext(_drawingPad.frame.size);
CGContextRef context1 = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(context1, 300, 300);
CGContextAddLineToPoint(context1, 400, 350);
CGContextAddLineToPoint(context1, 300, 400);
CGContextAddLineToPoint(context1, 250, 350);
CGContextAddLineToPoint(context1, 300, 300);
CGContextClosePath(context1);
//CGContextStrokePath(context1);
CGContextSetFillColorWithColor(context1, [UIColor redColor].CGColor);
CGContextFillPath(context1);
CGContextStrokePath(context1);
also I'm creating a line when touches begin.. but the fill path get erased before I create the line..
You're trying to draw path without creating a path.
Try the following: