i’m stuck at this problem. I need to draw a line between the previous end point to next start point. My code for drawing a line between 2 points is
- (void)drawRect:(CGRect)rect
{
CGContextRef c=UIGraphicsGetCurrentContext();
CGContextSetLineWidth(c, 4.0);
CGFloat red[4]={0.0f, 0.0f, 0.0f, 1.0f};
CGContextSetStrokeColor(c, red);
CGContextBeginPath(c);
CGContextMoveToPoint(c, 50.0f, 50.0f);
CGContextAddLineToPoint(c, 100.0f, 100.0f);
CGContextStrokePath(c) ;
}
How can i give multiple points, so that i can it shows like a graph.
Thanks in advance
Just add more
CGContextAddLineToPointcalls