Instance Method


Returns the distance (measured in meters) from the current object's location to the specified location.


func distance(from location: CLLocation) -> CLLocationDistance



The destination location.

Return Value

The distance (in meters) between the two locations.


This method measures the distance between the location in the current object and the value in the location parameter. The distance is calculated by tracing a line between the two points that follows the curvature of the Earth, and measuring the length of the resulting arc. The arc is a smooth curve that does not take into account altitude changes between the two locations.

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