title: detect if a point is inside a MKPolygon overlay
body: <p>I want to be able to tell if tap is within a MKPolygon.</p>
  
  <p>I have a MKPolygon:</p>
  
  <pre><code>CLLocationCoordinate2D  points[4];
  
  points[0] = CLLocationCoordinate2DMake(41.000512, -109.050116);
  points[1] = CLLocationCoordinate2DMake(41.002371, -102.052066);
  points[2] = CLLocationCoordinate2DMake(36.993076, -102.041981);
  points[3] = CLLocationCoordinate2DMake(36.99892, -109.045267);
  
  MKPolygon* poly = [MKPolygon polygonWithCoordinates:points count:4];
  
  [self.mapView addOverlay:poly];  
  
  //create UIGestureRecognizer to detect a tap
  UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(foundTap:)];
  tapRecognizer.numberOfTapsRequired = 1;
  tapRecognizer.numberOfTouchesRequired = 1;
  [self.mapView addGestureRecognizer:tapRecognizer];
  </code></pre>
  
  <p>its just a basic outline of the state Colorado.</p>
  
  <p>I got the tap to lat/long conversion set up:</p>
  
  <pre><code>-(IBAction)foundTap:(UITapGestureRecognizer *)recognizer
  {
      CGPoint point = [recognizer locationInView:self.mapView];
  
      CLLocationCoordinate2D tapPoint = [self.mapView convertPoint:point toCoordinateFromView:self.view];
  }
  </code></pre>
  
  <p>but i am unsure how to tech if my tap point is within the MKPolygon. there does not seem to be a method to do this check, so i'm guessing i need to convert the MKPolygon to a CGRect and use  CGRectContainsPoint. </p>
  
  <p>MKPolygon has a .points property but i can't seem to get them back out. </p>
  
  <p>any suggestions?</p>
  
  <p>EDIT:</p>
  
  <p>Both solutions below work in iOS 6 or lower, but breaks in iOS 7. In iOS 7 the <code>polygon.path</code> property allways returns <code>NULL</code>. Ms Anna was kind enough to provide <a href="https://stackoverflow.com/questions/19014926/detecting-a-point-in-a-mkpolygon-broke-with-ios7-cgpathcontainspoint">a solution in another SO question here</a>. It involves creating your own path from the polygon points to pass into <code>CGPathContainsPoint()</code>.</p>
  
  <p>image of my polygon:</p>
  
  <p><img src="https://i.stack.imgur.com/dW40i.png" alt="enter image description here"></p>