The latitude, longitude, and course information reported by the system.


@interface CLLocation : NSObject


A CLLocation object contains the geographical location and altitude of a device, along with values indicating the accuracy of those measurements and when they were collected. In iOS, a location object also contains course information—that is, the speed and heading in which the device was moving.

Typically, you do not create location objects yourself. After you request location updates from your CLLocationManager object, the system uses onboard sensors to gather location data and report that data to your app. Some services also return previously collected location data, which you can use as context to improve your services. You can always retrieve the most recently collected location from the UIApplicationLaunchOptionsLocationKey property of your CLLocationManager object. You may create location objects yourself when you want to cache custom location data or calculate the distance between two geographical coordinates.

Use CLLocation objects as is and do not subclass them.


Initializing a Location Object

- initWithLatitude:longitude:

Creates a location object with the specified latitude and longitude.

- initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:timestamp:

Creates a location object with the specified coordinate and altitude information.

- initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:course:speed:timestamp:

Creates a location object with the specified coordinate, altitude, and course information.

Getting the Location Attributes


The geographical coordinate information.


The altitude, measured in meters.


The logical floor of the building in which the user is located.


The radius of uncertainty for the location, measured in meters.


The accuracy of the altitude value, measured in meters.


The time at which this location was determined.

Measuring the Distance Between Coordinates

- distanceFromLocation:

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

- getDistanceFrom:

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


Getting Speed and Course Information


The instantaneous speed of the device, measured in meters per second.


The direction in which the device is traveling, measured in degrees and relative to due north.

Data Types


The velocity (measured in meters per second) at which the device is moving.


An azimuth that is measured in degrees relative to true north.


A distance measurement (measured in meters) from an existing location.


The accuracy of a geographical coordinate.

Instance Properties


Inherits From

See Also

Location Updates

Getting the User's Location

Receive location data in your app.


The latitude and longitude associated with a location, specified using the WGS 84 reference frame.


The floor of a building on which the user's device is located.


Information about the user's location during a specific period of time.

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