Join Steven Lipton for an in-depth discussion in this video Altimeter, part of Advanced iOS App Development: Core Motion.
[Narrator]- As you just heard in later model devices,…the altimeter measures barometric pressure…in kilopascals through core motion.…You do not reach it in device motion…or even the motion manager,…but as a raw sensor.…Let's add some code to our fencing project to…detect altitude changes.…Make a new function in the fencing demo…called 'myAltimeter'.…Close the console.…Just above 'myDeviceMotion', make a new function…called 'myAltimeter'.…
Check for the availability of the altimeter.…You do that with the 'isRelativeAltitudeAvailable'…class function.…If it's not available, print to the console…that we don't have one in the else statement.…Altimeters only have push updates.…We'll make an altimeter object and then start updates.…
First, head up to the top of the code…and make a property for the class for the altimeter.…We'll do a 'let altimeter = CMAltimeter'.…Back in the 'myAltimeter' function,…start the updates: 'altimeter.startRelativeAltitudeUpdates',…and we'll use the one with the handler…and the operation queue.…
- Reading Core Motion data
- Understanding Core Motion methods
- Creating a pedometer app
- Using pace and distance data from Core Motion
- Pushing and pulling device motion data
- Accessing the altitude sensors
- Working with the motion activity manager (CMMotionActivityManager)
Skill Level Advanced
iOS App Development: Accessibilitywith Kevin Favro2h 34m Intermediate
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
1. Core Motion Introduction
3. Device Motion
5. Recorded Data
Next steps1m 43s
- 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.