Instance Method

distance(from:)

Returns the distance (measured in meters) from the receiver’s location to the specified location.

Declaration

func distance(from location: CLLocation) -> CLLocationDistance

Parameters

location

The other location.

Return Value

The distance (in meters) between the two locations.

Discussion

This method measures the distance between the two locations by tracing a line between them that follows the curvature of the Earth. The resulting arc is a smooth curve and does not take into account specific altitude changes between the two locations.