The current drag state of the annotation view.
- iOS 4.0+
- macOS 10.9+
- Mac Catalyst 13.0+
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
set 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:
When the drag state changes to
MKAnnotation, you should set the state to
View Drag State Starting
MKAnnotation. If you perform an animation to indicate the beginning of a drag, you should perform that animation before changing the state. Changing the state to the new value lets the map know that your animations are done.
View Drag State Dragging
When the state changes to either
View Drag State Canceling
MKAnnotation, set the state to
View Drag State Ending
MKAnnotation. If you perform an animation at the end of a drag, you should perform that animation before changing the state.
View Drag State None
Changing the state to the
MKAnnotation 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
MKPin 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
MKAnnotation. If you do not want your annotation view to be draggable, set the
draggable property to