Starts the generation of updates that report the user’s current location.
- iOS 2.0+
- macOS 10.6+
- Mac Catalyst 13.0+Beta
- watchOS 3.0+
- Core Location
This method returns immediately. Calling this method causes the location manager to obtain an initial location fix (which may take several seconds) and notify your delegate by calling its
location method. After that, the receiver generates update events primarily when the value in the
distance property is exceeded. Updates may be delivered in other situations though. For example, the receiver may send another notification if the hardware gathers a more accurate location reading.
Calling this method several times in succession does not automatically result in new events being generated. Calling
stop in between, however, does cause a new initial event to be sent the next time you call this method.
If you start this service and your app is suspended, the system stops the delivery of events until your app starts running again (either in the foreground or background). If your app is terminated, the delivery of new location events stops altogether. Therefore, if your app needs to receive location events while in the background, it must include the
UIBackground key (with the
location value) in its
In addition to your delegate object implementing the
location method, it should also implement the
location method to respond to potential errors.