MKAnnotationView Push to View Controller when DetailDesclosure Button is Clicked

If you are using storyboards and have a segue from your current scene to your destination scene, you can just respond to calloutAccessoryControlTapped. For example: – (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { [self performSegueWithIdentifier:@”Details” sender:view]; } Obviously, you can check for the type of annotation associated with that view, etc., if you have different … Read more

Zooming MKMapView to fit annotation pins?

This is the one I found here that worked for me: (EDIT: I have updated the solution using @Micah’s suggestion to increase the pointRect by 0.1 to ensure the rect doesn’t end up being infinitesimally small!) MKMapRect zoomRect = MKMapRectNull; for (id <MKAnnotation> annotation in mapView.annotations) { MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); MKMapRect pointRect = MKMapRectMake(annotationPoint.x, … Read more

How to intercept touches events on a MKMapView or UIWebView objects?

The best way I have found to achieve this is with a Gesture Recognizer. Other ways turn out to involve a lot of hackish programming that imperfectly duplicates Apple’s code, especially in the case of multitouch. Here’s what I do: Implement a gesture recognizer that cannot be prevented and that cannot prevent other gesture recognizers. … Read more