I want to draw lines which is shown in the image.
and I have to add four labels with name Section 1,Section 2,Section 3,Section 4.
I have tried below code to draw lines and it works
-(UIBezierPath*)createBezierPathWithMoveToPoint:(CGPoint)moveToPoint andlineToPoint:(CGPoint)toPoint
{
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:moveToPoint];
[path addLineToPoint:toPoint];
return path;
}
-(CAShapeLayer*)createLayerWithPath:(CGPathRef)path strokColor:(UIColor *)colorStroke lineWidth:(CGFloat)width fillColor:(UIColor *)colorFill
{
CAShapeLayer *layer = [CAShapeLayer layer];
layer.path = path;
layer.strokeColor = [colorStroke CGColor];
layer.lineWidth = width;
layer.fillColor = [colorFill CGColor];
return layer;
}
By using above code I have achieved lines and I have added for UIlabel's manually. Can anyone please help me to get action like UIButton actions, when user touch in between these sections. ?
OR
If there is any best and easiest way to achieve this please let me know.