From the course: Advanced iOS App Development: Core Motion

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Motion activity manager

Motion activity manager - iOS Tutorial

From the course: Advanced iOS App Development: Core Motion

Start my 1-month free trial

Motion activity manager

- [Instructor] So far, we've looked at Core Motion as single events. For fitness apps and even some games, we'll want more than a single piece of data but history of motion data. You've seen that data scroll away in the Fencing app but not used in any way. Core Motion allows you to query historical data. Core Motion includes one API that evaluates this data into kinds of movement, the Motion Activity Manager. Use this class to determine the user's type of activity such as running, walking, and biking. We'll add to the Pedometer app our activity. Close the Fencing app or open it in a new window. There's two classes from the motion activity. Add these as properties. Let motionActivityManager equal CMMotionActivityManager. This class will start and stop the motion activity sensing and reporting. The second one we'll do is motion activity and that is CMMotionActivity and that's the description of the activity. Drop down to above the timer functions. We'll put a function in here to start…

Contents