From Xojo Documentation

Revision as of 18:17, 14 October 2020 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Class (inherits from Object)

New in 2016r2

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

Enabled Pitch fa-lock-32.png UpdateInterval
GravityAccelerationX fa-lock-32.png Roll fa-lock-32.png UserAccelerationX fa-lock-32.png
GravityAccelerationY fa-lock-32.png RotationRateX fa-lock-32.png UserAccelerationY fa-lock-32.png
GravityAccelerationZ fa-lock-32.png RotationRateY fa-lock-32.png UserAccelerationZ fa-lock-32.png
Handle fa-lock-32.png RotationRateZ fa-lock-32.png Yaw fa-lock-32.png
Shared Methods


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.

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.

See Also