Instance Method

showAnnotations(_:animated:)

Sets the visible region so that the map displays the specified annotations.

Declaration

func showAnnotations(_ annotations: [MKAnnotation], animated: Bool)

Parameters

annotations

The annotations that you want to be visible in the map.

animated

true if you want the map region change to be animated, or false if you want the map to display the new region immediately without animations.

Discussion

Calling this method updates the value in the region property and potentially other properties to reflect the new map region.

See Also

Manipulating the Visible Portion of the Map

var region: MKCoordinateRegion

The area currently displayed by the map view.

func setRegion(MKCoordinateRegion, animated: Bool)

Changes the currently visible region and optionally animates the change.

var centerCoordinate: CLLocationCoordinate2D

The map coordinate at the center of the map view.

func setCenter(CLLocationCoordinate2D, animated: Bool)

Changes the center coordinate of the map and optionally animates the change.

var visibleMapRect: MKMapRect

The area currently displayed by the map view.

func setVisibleMapRect(MKMapRect, animated: Bool)

Changes the currently visible portion of the map and optionally animates the change.

func setVisibleMapRect(MKMapRect, edgePadding: UIEdgeInsets, animated: Bool)

Changes the currently visible portion of the map, allowing you to specify additional space around the edges.