简体   繁体   中英

MKMapViewDelegate notifing when user moved the map

I use an MKMapView in my application, and implement its delegate. As with the Google Maps, I want to know when the user moved the map. If you open the Google Maps application, and press the GPS icon the button is set to the DONE style and the map centers to your location. Whenever you move the map the icon automatically gets back to PLAIN style.
How can I do the same thing?

Best regards,
Paul Peelen

I am not sure whether this will solve your problem. But try overriding regionDidChangeAnimated: method of MKMapViewDelegate .

Doc says : This method is called whenever the currently displayed map region changes. During scrolling, this method may be called many times to report updates to the map position. Therefore, your implementation of this method should be as lightweight as possible to avoid affecting scrolling performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM