Creates a location object with the specified latitude and longitude.
- iOS 2.0+
- macOS 10.6+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Location
The latitude of the geographical coordinate.
The longitude of the geographical coordinate.
A location object initialized with the specified geographical coordinate.
Use this method to create location objects that are not necessarily based on the user's current location. Typically, you acquire location objects from your
CLLocation object, which returns the user's actual location. However, you might use this method when you want to represent any location on a map. For example, you might create an object to represent the user's intended destination.
This method records the latitude and longitude values you provide, and it initializes other properties to appropriate default values. Specifically, this method sets the
horizontal properties to 0, sets the
vertical property to
-1 to indicate that the altitude is invalid, sets the
course values to
-1, and sets the
timestamp property to the time at which the returned object was created.