Starts the generation of updates that report the user’s current heading.
- iOS 3.0+
- Mac Catalyst 13.0+Beta
- Core Location
This method returns immediately. Calling this method when the receiver is stopped causes it to obtain an initial heading and notify your delegate. After that, the receiver generates update events when the value in the
heading property is exceeded.
Before calling this method, you should always check the
heading property to see whether heading information is supported on the current device. If heading information is not supported, calling this method has no effect and does not result in the delivery of events to your delegate.
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 heading events stops altogether and must be restarted by your code when the app is relaunched.
Heading events are delivered to the
location method of your delegate. If there is an error, the location manager calls the
location method of your delegate instead.