Class
iOSMotion
Warning
This item was deprecated in version 2020r2. Please use MobileMotion as a replacement.
Description
iOSMotion provides motion updates from the device. These motion updates from iOS are combined from both the accelerometer and gyroscope.
Properties
Name |
Type |
Read-Only |
Shared |
---|---|---|---|
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
iOSMotion |
Property descriptions
iOSMotion.Enabled
Enabled As 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).
iOSMotion.GravityAccelerationX
GravityAccelerationX As 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.
iOSMotion.GravityAccelerationY
GravityAccelerationY As 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.
iOSMotion.GravityAccelerationZ
GravityAccelerationZ As 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.
iOSMotion.Handle
Handle As Ptr
A pointer to the underlying CMMotionManager.
This property is read-only.
iOSMotion.Pitch
Pitch As 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.
iOSMotion.Roll
Roll As 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.
iOSMotion.RotationRateX
RotationRateX As Double
The X-axis rotation rate in radians per second.
This property is read-only.
iOSMotion.RotationRateY
RotationRateY As Double
The Y-axis rotation rate in radians per second.
This property is read-only.
iOSMotion.RotationRateZ
RotationRateZ As Double
The Z-axis rotation rate in radians per second.
This property is read-only.
iOSMotion.UpdateInterval
UpdateInterval As Integer
Set to change how often iOS should update from the sensors, in milliseconds.
Shorter intervals result in increased battery usage.
iOSMotion.UserAccelerationX
UserAccelerationX As 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.
iOSMotion.UserAccelerationY
UserAccelerationY As 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.
iOSMotion.UserAccelerationZ
UserAccelerationZ As 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.
iOSMotion.Yaw
Yaw As 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
iOSMotion.GetObject
GetObject As iOSMotion
Returns the singleton object instance for iOSMotion.
Save the object instance to a MyiOSMotion property:
MyiOSMotion = iOSMotion.GetObject
Notes
Only one iOSMotion object can be created per application for performance reasons. To get this object, use the GetObject shared method. You cannot create a new iOSMotion instance using "New iOSMotion".
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.
Note
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.
Compatibility
iOS projects on the iOS operating system.
See also
Object parent class; CMMotionManager