Class

CMMotionActivityManager

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

Overview

Motion data reflects whether the user is walking, running, in a vehicle, or stationary for periods of time. A navigation app might look for changes in the current type of motion and offer different directions for each. Using this class, you can ask for notifications when the current type of motion changes or you can gather past motion change data.

Topics

Determining Activity Availability

class func isActivityAvailable()

Returns a Boolean indicating whether motion data is available on the current device.

class func authorizationStatus()

Returns a value indicating whether the app is authorized to retrieve stored motion data.

enum CMAuthorizationStatus

The authorization status for motion-related features.

Starting and Stopping Activity Updates

func startActivityUpdates(to: OperationQueue, withHandler: CMMotionActivityHandler)

Starts the delivery of current motion data updates to your app.

func stopActivityUpdates()

Stops the delivery of motion updates to your app

typealias CMMotionActivityHandler

A block that reports the current motion associated with the device.

Getting Historical Activity Data

typealias CMMotionActivityQueryHandler

A block that reports the motion updates that occurred between the specified query interval.

Relationships

Inherits From

Conforms To

See Also

Historical Data

class CMMotionActivity

The data for a single motion update event.