Instance Property

location

The most recently retrieved user location.

Declaration

@NSCopying var location: CLLocation? { get }

Discussion

The value of this property is nil if no location data has ever been retrieved.

In iOS 4.0 and later, this property may contain a more recent location object at launch time. Specifically, if significant location updates are running and your app is terminated, this property is updated with the most recent location data when your app is relaunched (and you create a new location manager object). This location data may be more recent than the last location event processed by your app.

It is always a good idea to check the timestamp of the location stored in this property. If the receiver is currently gathering location data, but the minimum distance filter is large, the returned location might be relatively old. If it is, you can stop the receiver and start it again to force an update.

See Also

Getting Recently Retrieved Data

var heading: CLHeading?

The most recently reported heading.