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.

Query motion data

Query motion data - iOS Tutorial

From the course: Advanced iOS App Development: Core Motion

Start my 1-month free trial

Query motion data

- [Narrator] The activity motion manager takes a series of motions and interprets it into an activity. Running is a series of rapid arm movements, walking, slower movements. Core motion records these motions for later query, so you can track your activities. Let's display the activities from the pedometer onto the console, add a new function for the pedometer. And to get there, let's first of all stop the app, and go ahead and close the console, and we can close the Navigator as well. Just above display pedometer data, make a new function, read activity data. Now, the activity manager is a method which retrieves activity information, and then runs a handler with those results. That is motion activity manager, query, activity started from two with handler. This uses two dates, a from date and a to date, which is a start and end. I want to caution you about these dates. The activity manager is very slow in registering activities for a query. Activities will take up to half an hour…

Contents