From the course: Advanced iOS App Development: Core Motion
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Add the pedometer - iOS Tutorial
From the course: Advanced iOS App Development: Core Motion
Add the pedometer
- [Instructor] You've just set the privacy motion usage description setting in the info.plist. Make sure you have done this step before going further because the app may not work otherwise. We'll need a user interface for this project. To save you time, I created one for you already. Open the project in the downloads folder for this video, and you'll find a project user interface in the main storyboard. This is a stack view of five labels and one button. Open up the assistant editor. You'll see I set up outlets for the label and an action for the button. I also added some constants for dynamically changing the button color. Close the assistant editor. In the project navigator, click the viewcontroller.swift file. A very critical line just goes after the import UIKit line, where we import core motion so that we can use those methods. Next we'll add an instance of a pedometer. Add a property to the view controller. Var pedometer equals cm pedometer. You use the start/stop pedometer…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.