PencilKit help

I am making a code that uses pencilKit and you can draw on the canvas. However, I want to be able to detect if the resulted drawing is in contact with a Rectangle(). Is there any way to do this? I dont want to use variables for X and Y positions because I have more than 400 rectangles in a grid.

Do you want to test if the drawing (closed shape ?) is in contact with any Rectangle ?

Please explain more precisely the context.

PencilKit help
 
 
Q