Draggable Annotation Views

Draggable annotation views can be useful to allow the user to mark a place on a map. In the sample app, there is one special favorite place to indicate where the user is going next, represented by a green arrow. An annotation view can be made draggable by setting the draggable property when the annotation view is being configured for presentation.

[view setDraggable:YES];

The user can then drag the annotation view anywhere on the map. To get more information about the dragging performed on an annotation view, the map view delegate implements the mapView:annotationView:didChangeDragState:fromOldState: method. That method will fire anytime the dragging state changes for a draggable annotation view, and indicates whether ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.