iOS Developer Library

Developer

Core Location Functions Reference

Options
Deployment Target:

On This Page
Language:

Core Location Functions Reference

The Core Location framework provides functions to help you work with coordinate values.

Functions

  • Returns a Boolean indicating whether the specified coordinate is valid.

    Declaration

    BOOL CLLocationCoordinate2DIsValid( CLLocationCoordinate2D coord)

    Parameters

    coord

    A coordinate containing latitude and longitude values.

    Return Value

    YEStrue if the coordinate is valid or NOfalse if it is not.

    Discussion

    A coordinate is considered invalid if it meets at least one of the following criteria:

    • Its latitude is greater than 90 degrees or less than -90 degrees.

    • Its longitude is greater than 180 degrees or less than -180 degrees.

  • Formats a latitude and longitude value into a coordinate data structure format.

    Declaration

    CLLocationCoordinate2D CLLocationCoordinate2DMake( CLLocationDegrees latitude, CLLocationDegrees longitude)

    Parameters

    latitude

    The latitude for the new coordinate.

    longitude

    The longitude for the new coordinate.

    Return Value

    A coordinate structure encompassing the latitude and longitude values.