Join Steven Lipton for an in-depth discussion in this video Add a timer loop, part of Advanced iOS App Development: Core Motion.
[Instructor] You found out that pushing data…to a label leads to bugs.…Let's find some less direct solutions.…First, we'll set a property…and let a property observer set the label.…Close the console.…Let's make a new property.…The top of our code.…Define the number of steps property…with a property observer to update the label.…There, number of steps.…Make it a explicit optional integer,…so INT exclamation point equals nil.…
And then add the property observer with did set…and we're going to make steps label dot text…equal to string, format, steps.…Format again integer, comma, number of steps.…When the property changes, the label changes.…
Head back down in our code…and let's comment out the assignment in the closure.…The pedometer number of steps property is an NS number.…You have to cast to an INT to use…the use the view controller number of steps property.…So under the comment, add this.…Self dot number of steps equals INT…pedometer data dot number of steps.…
Okay, we're ready to go.…Set your phone to the correct device.…
- 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?
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.