In my app I have an array of points which have been added by the user and I want to be able to create a filled shape from these points.
I also want to be able to get any taps within the shape (not the rectangular frame of the shape but the actual shape itself). Also, if the tap is not within the shape (but possibly still within the shape’s frame), I want the tap to be ‘passed down’ to a shape underneath if there is one.
In a sense, I am trying to create an irregularly shaped UIButton from an array of points.
UIView.UIBezierPathproperty from the points array (moveToPoint:andaddLineToPoint:).drawRect:, use the bezier path to draw the shape (callfillorstrokeor both).pointInside:withEvent:and return the correct value based on the return value of-[UIBezierPath containsPoint:].Make sure to convert correctly between the view’s and path’s coordinate systems if they differ from each other.