Instance Property

dragState

The current drag state of the annotation view.

Declaration

@property(nonatomic) MKAnnotationViewDragState dragState;

Discussion

Applications targeting iOS 4.1 and earlier can use this property to support drag operations in custom annotation views. If your application runs in iOS 4.2 or later, you should override the setDragState:animated: method and use it to manage the drag state instead.

To support drag operations, you must override the implementation of this property and update the drag state at the following times:

Changing the state to the MKAnnotationViewDragStateDragging or MKAnnotationViewDragStateNone value is the way to signal to the map view that you are done with any animations you wanted to perform. For example, when a drag operation begins for a pin annotation, the MKPinAnnotationView class executes an animation to lift the pin off the map. Similarly, when the pin is dropped, the class performs a drop animation. Even if you do not perform any animations, you should still change the value of this property to reflect the correct state.

You must not try to abort a new drag operation by changing the state from MKAnnotationViewDragStateStarting to MKAnnotationViewDragStateNone. If you do not want your annotation view to be draggable, set the draggable property to NO.

See Also

Supporting Drag Operations

draggable

A Boolean indicating whether the annotation view is draggable.

- setDragState:animated:

Sets the current drag state for the annotation view.