iOS Developer Library

Developer

CoreLocation Framework Reference Core Location Data Types Reference

Options
Deployment Target:

On This Page
Language:

Core Location Data Types Reference

This document describes the data types found in the Core Location framework.

Data Types

  • Represents the accuracy of a coordinate value in meters.

    Declaration

    Swift

    typealias CLLocationAccuracy = Double

    Objective-C

    typedef double CLLocationAccuracy;

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 2.0 and later.

  • A structure that contains a geographical coordinate using the WGS 84 reference frame.

    Declaration

    Swift

    struct CLLocationCoordinate2D { var latitude: CLLocationDegrees var longitude: CLLocationDegrees }

    Objective-C

    typedef struct { CLLocationDegrees latitude; CLLocationDegrees longitude; } CLLocationCoordinate2D;

    Fields

    latitude

    The latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator.

    longitude

    The longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian.

    Availability

    Available in iOS 2.0 and later.

  • Represents a latitude or longitude value specified in degrees.

    Declaration

    Swift

    typealias CLLocationDegrees = Double

    Objective-C

    typedef double CLLocationDegrees;

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 2.0 and later.

  • Represents a direction that is measured in degrees relative to true north.

    Declaration

    Swift

    typealias CLLocationDirection = Double

    Objective-C

    typedef double CLLocationDirection;

    Discussion

    Direction values are measured in degrees starting at due north and continue clockwise around the compass. Thus, north is 0 degrees, east is 90 degrees, south is 180 degrees, and so on. A negative value indicates an invalid direction.

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 2.2 and later.

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

    Declaration

    Swift

    typealias CLLocationDistance = Double

    Objective-C

    typedef double CLLocationDistance;

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 2.0 and later.

  • Represents the speed at which the device is moving in meters per second.

    Declaration

    Swift

    typealias CLLocationSpeed = Double

    Objective-C

    typedef double CLLocationSpeed;

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 2.2 and later.