Question

I have a series of UIBezierPaths that I combine and add to a CAShapeLayer. I need to detect where on the shape layer the user touches. However, because I changed the position of the shape layer, when I tap on the shape layer, it does not detect the tap because it is comparing the tap coordinates with the coordinates of the bezier paths original location. Does anyone know if I can simply get a tap on the current location of a CAShapeLayer? Instead of relying on its underlying bezier paths for the tap origin.

Was it helpful?

Solution

I solved the problem with a somewhat ugly hack. Subtract the touch point's x and y by the amount the shape layer is moved. It works, but maybe there is a better solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top