Cómo dibujar la línea en el patrón de imagen exactamente

Tengo un UIImageView. Dentro de eso, estoy dibujando una línea con el evento táctil del usuario. El problema es que se puede dibujar una línea en cualquier lugar deUIImageview, pero me gusta dibujar líneas con patrones de imágenes solamente.

Por ejemplo, mira esta imagen. Necesito dibujar una línea solo en el patrón de imagen.

Este es mi código:

-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{

    UITouch *touch = [[event allTouches] anyObject];
    touchPoint = [touch locationInView:self.imgColor];
    UIBezierPath *path = [UIBezierPath bezierPath];
    [path moveToPoint:CGPointMake(touchPoint.x,touchPoint.y)];
    [path addLineToPoint:CGPointMake(startingPoint.x,startingPoint.y)];
    startingPoint=touchPoint;
    CAShapeLayer *shapeLayer = [CAShapeLayer layer];
    shapeLayer.path = [path CGPath];
    shapeLayer.strokeColor = [[UIColor blueColor] CGColor];
    shapeLayer.lineWidth = 3.0;
    shapeLayer.fillColor = [[UIColor redColor] CGColor];
    [self.imgColor.layer addSublayer:shapeLayer];
    [arrLayer addObject:shapeLayer];
    NSLog(@"Touch moving point =x : %f Touch moving point =y : %f", touchPoint.x, touchPoint.y);



}

Espero que alguien resuelva mi problema.

Respuestas a la pregunta(2)

Su respuesta a la pregunta