hgbnerd hgbnerd - 1 year ago 90
iOS Question

determine if MKMapView was dragged/moved

Is there a way to determine if a MKMapView was dragged around?

I want to get the center location every time a user drags the map using

CLLocationCoordinate2D centre = [locationMap centerCoordinate];
but I'd need a delegate method or something that fires as soon as the user navigates around with the map.

Thanks in advance

Answer Source

Look at the MKMapViewDelegate reference.

Specifically, these methods may be useful:

- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated

Make sure your map view's delegate property is set so those methods get called.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download