[enter image description here][1]I have a bezierpath for an unclosed structure. I want to detect tap only when clicked on the path, and not for taps on the area enclosed by the path.If I use path.contains, it giving me true even for taps enclosed by path.
bezier.contains(touchPoint)
has grey path which is created using code below, I would like to detect the clicks on gray portions only and not inside the area surrounded by gray portion.
let color:UIColor = getColor(structure.category)
let bpath:UIBezierPath = UIBezierPath()
beziers.append(bpath);
bpath.move(to: structure.points[0].fromPoint)
for point in structure.points {
bpath.addCurve(to: point.toPoint, controlPoint1:point.controlPointOne, controlPoint2: point.controlPointTwo)
}
bpath.lineWidth = 5.0
color.set()
bpath.stroke()