CGContextSetLineWidth(ctx, 0.5f); CGContextSetStrokeColorWithColor(ctx, [UIColor alloc] blackColor].CGColor); CGContextMoveToPoint(ctx, 10, 0); CGContextAddLineToPoint(ctx, 10, 100); CGContextStrokePath(ctx); CGFloat lineWidth = 0.5f; CGContextSetLineWidth(ctx, lineWidth); CGContextSetStrokeColorWithColor(ctx, [UIColor alloc] blackColor].CGColor); CGContextMoveToPoint(ctx, 10+lineWidth*0.5, 0); CG