O'Reilly logo

Mastering iOS 11 Programming - Second Edition by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tracking the user's location while they're on the move

If you're tracking user movement, there are a couple of methods that CLLocationManager calls. As with the other CoreLocation features, CLLocationManager is at the center of movement-related events.

One of the methods is already covered: locationManager(_:didUpdateLocations:). This is the method you're interested in if you want to track the user's location throughout, for example, a run, or a bicycle ride. If you're not interested in your user's exact location, but you want to be notified if the user changes the direction they're heading in, you can use the locationManager(_:didUpdateHeading:) method.

The locationManager(_:didUpdateHeading:) is called with a CLHeading instance. This instance ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required