I am creating an application that allows the user to draw on the screen with a finger of different colors. Drawings are drawn using UIBezierPaths, but I need an eraser. I had an eraser that was just expensive with a background image as a color, but this method causes memory problems. I would like to remove points from any path that is drawn when the eraser is selected.
Unfortunately, UIBezierPath does not have a subtraction function, so I want to make my own. Therefore, if an eraser is selected, it will look at all the points that should be deleted and see if any of the existing paths contain these points, then divide the path, leaving an empty space. But he should be able to see how many points in the line to delete, not to do this one at a time. In theory, this makes sense, but it's hard for me to start working on an implementation.
Does anyone have any directions to set me on the right path?
source share