Instance Method

addAnnotation(_:)

Adds the specified annotation to the map view.

Declaration

func addAnnotation(_ annotation: MKAnnotation)

Parameters

annotation

The annotation object to add to the receiver. This object must conform to the MKAnnotation protocol. The map view retains the specified object.

See Also

Annotating the Map

var annotations: [MKAnnotation]

The complete list of annotations associated with the receiver.

func addAnnotations([MKAnnotation])

Adds an array of annotation objects to the map view.

func removeAnnotation(MKAnnotation)

Removes the specified annotation object from the map view.

func removeAnnotations([MKAnnotation])

Removes an array of annotation objects from the map view.

func view(for: MKAnnotation)

Returns the annotation view associated with the specified annotation object, if any.

func annotations(in: MKMapRect)

Returns the annotation objects located in the specified map rectangle.

var annotationVisibleRect: CGRect

The visible rectangle where annotation views are currently being displayed.

func dequeueReusableAnnotationView(withIdentifier: String)

Returns a reusable annotation view located by its identifier.