In a SO question I asked earlier this year, I got this chunk of code:
MKPolygonView *polygonView = (MKPolygonView *)[self.mapView viewForOverlay:polygon];
MKMapPoint mapPoint = MKMapPointForCoordinate(tapCoord);
CGPoint polygonViewPoint = [polygonView pointForMapPoint:mapPoint];
if (CGPathContainsPoint(polygonView.path, NULL, polygonViewPoint, FALSE)) {
// do stuff
}
This works great up until iOS7. It now always returns false and will not detect a point with the path.
I'm trying to find any documentation stating that the method change, but can't find any.
Any ideas why it broke? Or a new solution?
MKPolygon
is not visible, thepolygon.path
property will returnNULL
in iOS 6. This solution works like a charm, thank you very much Ms Anna! – Cultivated