An object used to sort records containing location data.


class CKLocationSortDescriptor : NSSortDescriptor


You can add a location sort descriptor to your queries when searching for records. At creation time, you must provide the sort descriptor with a key whose value is a CLLocation object. The sort descriptor uses the value of that key to perform the sort.

Distances are computed by drawing a direct line between the two locations that follows the curvature of the Earth. Distances do not take into account altitude changes between the two locations.


Initializing a Location Sort Descriptor

init(key: String, relativeLocation: CLLocation)

Initializes and returns a location sort descriptor object.

Accessing the Location Value

var relativeLocation: CLLocation

The reference location against which records are sorted.


Inherits From

See Also


class CKQueryOperation

An operation used to execute queries against a database.

class CKQuery

A query that describes the criteria to apply when searching for records in a database.

class CKQueryOperation.Cursor

An object that marks the stopping point for a query and the starting point for retrieving the remaining results.