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.

Replies

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

Please explain more precisely the context.

  • No, I want to test if the drawing touches a rectangle. I have a group of red rectangles and blue rectangles, and I want to test if the blue rectangles touched the drawing. the drawing and rectangles are in a ZStack, and the drawing's canvas is set to transparent so it looks like the drawing is done ON to the grid of rectangles. From there, I want to test if the drawing, at ANY point is in contact with one or more of the blue rectangles. Hope this will make me clear.

Add a Comment