CMMotionActivity class contains the data for a single motion update event. On devices that support motion, you can use a
CMMotionActivityManager object to request updates when the current type of motion changes. When a change occurs, the update information is packaged into a
CMMotionActivity object and sent to your app.
- iOS 7.0+
- watchOS 2.0+
The motion-related properties of this class are not mutually exclusive. In other words, it is possible for more than one of the motion-related properties to contain the value
true. For example, if the user was driving in a car and the car stopped at a red light, the update event associated with that change in motion would have both the
stationary properties set to
true. It is also possible for all of the properties to be set to
false when the device is in motion but the movement does not correlate to walking, running, cycling or automotive travel.
You do not create instances of this class yourself. The
CMMotionActivityManager object creates them and sends them to the handler block you registered. For more information about how to initiate the delivery of motion activity updates to your app, see