An annotation view that displays a pin image on the map.


class MKPinAnnotationView : MKAnnotationView


Return instances of this class from the mapView(_:viewFor:) method of your map view delegate when you want to display a pin for one of your annotations. The pins displayed by this view are the same ones found in the Maps application. You can specify the type of pin you want to display and whether you want the pin to be animated into place.


Getting Standard Pin Colors

class func redPinColor() -> UIColor

Returns the standard color for red pins.

class func greenPinColor() -> UIColor

Returns the standard color for green pins.

class func purplePinColor() -> UIColor

Returns the standard color for purple pins.

enum MKPinAnnotationColor

The supported colors for pin annotations.


Getting and Setting Attributes

var pinTintColor: UIColor!

The color of the pin head.

var animatesDrop: Bool

A Boolean value indicating whether the annotation view is animated onto the screen.

var pinColor: MKPinAnnotationColor

The color of the pin head.


See Also

Point-Based Location

Annotating a Map with Custom Data

Annotate a map with location-specific data using default and customized annotation views and callouts.

class MKPointAnnotation

A concrete annotation object tied to the specified point on the map.

class MKMarkerAnnotationView

An annotation view that displays a balloon-shaped marker at the designated location.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software