Contents

CLLocationCoordinate2DIsValid(_:)

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

Declaration

func CLLocationCoordinate2DIsValid(_ coord: CLLocationCoordinate2D) -> Bool

Parameters

  • coord:

    A coordinate containing latitude and longitude values.

Return Value

true if the coordinate is valid or false 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.

See Also

Validating a coordinate