I want to handle 2 separate events: 1. User drags the map. 2. Map location changed (due to location change).
So far region[Did/Will]ChangeAnimated
is called on those 2 events. How can I distinguish between these events?
I want to handle 2 separate events: 1. User drags the map. 2. Map location changed (due to location change).
So far region[Did/Will]ChangeAnimated
is called on those 2 events. How can I distinguish between these events?
There are two distinct methods you can implement in your map view delegate to respond to these two events:
When the user drags the map around (or rotates it, or pinches/taps to zoom in, etc.): mapView:regionDidChangeAnimated:
When the map view is tracking the user's location and updates the view as the user's location changes: mapView:didUpdateUserLocation:
Try implementing both of these methods with some NSLog statements and mess around with the map view to get an idea of when and how frequently these methods are called.