Chapter    4

Using Core Motion to Save Motion Data

Ahmed Bakir

Introduction

In the last chapter, you learned how to set up an application for HealthKit, Apple’s shared repository for health data, and query for specific health data types. In this chapter, you will learn how to use Core Motion to access live motion data from a user’s device, and how to save it back to HealthKit, where it will be accessible to all applications.

In this chapter, you continue to expand the RunTracker app that you started in Chapter 3. In this chapter, we cover the following concepts:

  • How to access hardware using Core Motion
  • How to save information collected over time using Core Motion
  • How to save information to HealthKit
  • How to receive real-time activity updates from ...

Get Program the Internet of Things with Swift for iOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.