---
title: CMMotionActivityManager
framework: coremotion
role: symbol
role_heading: Class
path: coremotion/cmmotionactivitymanager
---

# CMMotionActivityManager

An object that manages access to the motion data stored by the device.

## Declaration

```swift
class CMMotionActivityManager
```

## Overview

Overview Motion data reflects whether the user is walking, running, in a vehicle, or stationary for periods of time. Using this class, you can ask for notifications when the current type of motion changes or you can gather past motion change data. For example, a navigation app might look for changes in the current type of motion and offer different directions for each. important: To use this API, you must include the NSMotionUsageDescription key in your app’s Info.plist file and provide a usage description string for this key. The usage description appears in the prompt that the user must accept the first time the system asks the user to access motion data for your app. If you don’t include a usage description string, your app crashes when you call this API.

## Topics

### Determining Activity Availability

- [isActivityAvailable()](coremotion/cmmotionactivitymanager/isactivityavailable().md)
- [authorizationStatus()](coremotion/cmmotionactivitymanager/authorizationstatus().md)
- [CMAuthorizationStatus](coremotion/cmauthorizationstatus.md)

### Starting and Stopping Activity Updates

- [startActivityUpdates(to:withHandler:)](coremotion/cmmotionactivitymanager/startactivityupdates(to:withhandler:).md)
- [stopActivityUpdates()](coremotion/cmmotionactivitymanager/stopactivityupdates().md)
- [CMMotionActivityHandler](coremotion/cmmotionactivityhandler.md)

### Getting Historical Activity Data

- [queryActivityStarting(from:to:to:withHandler:)](coremotion/cmmotionactivitymanager/queryactivitystarting(from:to:to:withhandler:).md)
- [CMMotionActivityQueryHandler](coremotion/cmmotionactivityqueryhandler.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Activity

- [CMHeadphoneActivityManager](coremotion/cmheadphoneactivitymanager.md)
- [CMMotionActivity](coremotion/cmmotionactivity.md)
- [Getting motion-activity data from headphones](coremotion/getting-motion-activity-data-from-headphones.md)
