Learn to determine a user's current heading from the magnetometer.
- [Instructor] While you just found…heading data from location data, you may…not want to use location data to get a heading.…As with the stationary point in Apple's…parking lot, you can't get a heading without moving.…Often, you'll just want heading…data from the magnetometer.…You can get raw magnetometer data in the…Core Motion framework, and if you are interested,…take a look at the Core Motion course.…With a few position checks, Core Location…can stabilize magnetometer data to make…a pretty good compass for many applications.…You'll find that setting up heading…is the same as setting up position.…
I'll make a property in my view…controller class called heading set…and set it to 0.0, or due north.…Now go to enable, location services,…and add another if clause.…Check if there's a magnetometer.…If CLLocation manager heading available.…
If there is, I'm going to start updating heading,…very much like I just did with positions.…If I have no magnetometer, I'm going to print…that the heading is not available.…You'll need another delegate to update…
- Getting coordinates from the web
- Working with Core Location data types and regions
- Creating a map in 2D, 3D, satellite, and flyover views
- Adding annotations
- Adding overlays
- Finding the current location
- Tracking heading, speed, and region
- Searching for locations
- Requesting and displaying directions
Skill Level Intermediate
iOS App Development: Test-Driven Developmentwith Harrison Ferrone2h 14m Intermediate
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
1. Basic Map and Location Concepts
5. Current Location
6. Heading, Speed, and Regions
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.