<div class="meta" robots="noindex">

</div>

Class

# iOSMotion

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `MobileMotion</api/mobile/mobilemotion>` as a replacement.

</div>

## Description

iOSMotion provides motion updates from the device. These motion updates from iOS are combined from both the accelerometer and gyroscope.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                   | Type                                        | Read-Only | Shared |
|--------------------------------------------------------|---------------------------------------------|-----------|--------|
| `Enabled<iosmotion.enabled>`                           | `Boolean</api/data_types/boolean>`          |           |        |
| `GravityAccelerationX<iosmotion.gravityaccelerationx>` | `Double</api/data_types/double>`            | ✓         |        |
| `GravityAccelerationY<iosmotion.gravityaccelerationy>` | `Double</api/data_types/double>`            | ✓         |        |
| `GravityAccelerationZ<iosmotion.gravityaccelerationz>` | `Double</api/data_types/double>`            | ✓         |        |
| `Handle<iosmotion.handle>`                             | `Ptr</api/data_types/additional_types/ptr>` | ✓         |        |
| `Pitch<iosmotion.pitch>`                               | `Double</api/data_types/double>`            | ✓         |        |
| `Roll<iosmotion.roll>`                                 | `Double</api/data_types/double>`            | ✓         |        |
| `RotationRateX<iosmotion.rotationratex>`               | `Double</api/data_types/double>`            | ✓         |        |
| `RotationRateY<iosmotion.rotationratey>`               | `Double</api/data_types/double>`            | ✓         |        |
| `RotationRateZ<iosmotion.rotationratez>`               | `Double</api/data_types/double>`            | ✓         |        |
| `UpdateInterval<iosmotion.updateinterval>`             | `Integer</api/data_types/integer>`          |           |        |
| `UserAccelerationX<iosmotion.useraccelerationx>`       | `Double</api/data_types/double>`            | ✓         |        |
| `UserAccelerationY<iosmotion.useraccelerationy>`       | `Double</api/data_types/double>`            | ✓         |        |
| `UserAccelerationZ<iosmotion.useraccelerationz>`       | `Double</api/data_types/double>`            | ✓         |        |
| `Yaw<iosmotion.yaw>`                                   | `Double</api/data_types/double>`            | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                             | Parameters | Returns   | Shared |
|----------------------------------|------------|-----------|--------|
| `GetObject<iosmotion.getobject>` |            | iOSMotion |        |

## Property descriptions

<div id="iosmotion.enabled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.Enabled

**Enabled** As `Boolean</api/data_types/boolean>`

Default is False. Set to True to begin asking for motion data. This should only be set to True for as long as motion data is required (in some apps, that may be constant, in others just on-demand).

<div id="iosmotion.gravityaccelerationx">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.GravityAccelerationX

**GravityAccelerationX** As `Double</api/data_types/double>`

The X-axis gravity acceleration. Gravity-caused acceleration is constantly downward, and could be used to present something as always "right side up" or other things relating to the ground position.

This property is read-only.

<div id="iosmotion.gravityaccelerationy">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.GravityAccelerationY

**GravityAccelerationY** As `Double</api/data_types/double>`

The Y-axis gravity acceleration. Gravity-caused acceleration is constantly downward, and could be used to present something as always "right side up" or other things relating to the ground position.

This property is read-only.

<div id="iosmotion.gravityaccelerationz">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.GravityAccelerationZ

**GravityAccelerationZ** As `Double</api/data_types/double>`

The Z-axis gravity acceleration. Gravity-caused acceleration is constantly downward, and could be used to present something as always "right side up" or other things relating to the ground position.

This property is read-only.

<div id="iosmotion.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

A pointer to the underlying CMMotionManager.

This property is read-only.

<div id="iosmotion.pitch">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.Pitch

**Pitch** As `Double</api/data_types/double>`

A pitch is a rotational position around a lateral axis that passes through the device from side to side.

This property is read-only.

<div id="iosmotion.roll">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.Roll

**Roll** As `Double</api/data_types/double>`

A roll is a rotational position around a longitudinal axis that passes through the device from its top to bottom.

This property is read-only.

<div id="iosmotion.rotationratex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.RotationRateX

**RotationRateX** As `Double</api/data_types/double>`

The X-axis rotation rate in radians per second.

This property is read-only.

<div id="iosmotion.rotationratey">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.RotationRateY

**RotationRateY** As `Double</api/data_types/double>`

The Y-axis rotation rate in radians per second.

This property is read-only.

<div id="iosmotion.rotationratez">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.RotationRateZ

**RotationRateZ** As `Double</api/data_types/double>`

The Z-axis rotation rate in radians per second.

This property is read-only.

<div id="iosmotion.updateinterval">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.UpdateInterval

**UpdateInterval** As `Integer</api/data_types/integer>`

Set to change how often iOS should update from the sensors, in milliseconds.

Shorter intervals result in increased battery usage.

<div id="iosmotion.useraccelerationx">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.UserAccelerationX

**UserAccelerationX** As `Double</api/data_types/double>`

The X-axis user-caused acceleration. User-caused acceleration could be used for detecting things like shakes and other purposeful movement in space.

This property is read-only.

<div id="iosmotion.useraccelerationy">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.UserAccelerationY

**UserAccelerationY** As `Double</api/data_types/double>`

The Y-axis user-caused acceleration. User-caused acceleration could be used for detecting things like shakes and other purposeful movement in space.

This property is read-only.

<div id="iosmotion.useraccelerationz">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.UserAccelerationZ

**UserAccelerationZ** As `Double</api/data_types/double>`

The Z-axis user-caused acceleration. User-caused acceleration could be used for detecting things like shakes and other purposeful movement in space.

This property is read-only.

<div id="iosmotion.yaw">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.Yaw

**Yaw** As `Double</api/data_types/double>`

A yaw is a rotational position around an axis that runs vertically through the device. It is perpendicular to the body of the device, with its origin at the center of gravity and directed toward the bottom of the device.

This property is read-only.

## Method descriptions

<div id="iosmotion.getobject">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMotion.GetObject

**GetObject** As iOSMotion

Returns the singleton object instance for <span class="title-ref">iOSMotion</span>.

Save the object instance to a MyiOSMotion property:

``` xojo
MyiOSMotion = iOSMotion.GetObject
```

## Notes

Only one <span class="title-ref">iOSMotion</span> object can be created per application for performance reasons. To get this object, use the GetObject shared method. You cannot create a new <span class="title-ref">iOSMotion</span> instance using "New <span class="title-ref">iOSMotion</span>".

You can check and compare the property values at specific points in your code or regularly using a Timer. To save on battery, you should disable motion detection when it is not needed.

The motion properties below return real values only when the Enabled property is True. Otherwise, they return 0.

<div class="note">

<div class="title">

Note

</div>

The iOS Simulator does not provide motion data, so you will need to test on an app running on an actual device to see how these property values change.

</div>

## Compatibility

iOS projects on the iOS operating system.

## See also

`Object</api/data_types/additional_types/object>` parent class; [CMMotionManager](https://developer.apple.com/library/ios/documentation/CoreMotion/Reference/CMMotionManager_Class/)
