CMGyroData
An instance of the CMGyroData
class contains a single measurement of the device’s rotation rate.
An application receives or samples CMGyroData
objects at regular intervals after calling the startGyroUpdatesToQueue:withHandler:
method or the startGyroUpdates
method of the CMMotionManager
class.

rotationRate rotationRate
PropertyThe rotation rate as measured by the device’s gyroscope. (readonly)
Declaration
Swift
var rotationRate: CMRotationRate { get }
ObjectiveC
@property(readonly, nonatomic) CMRotationRate rotationRate
Discussion
This property yields a measurement of the device’s rate of rotation around three axes. Whereas this property gives the raw data from the gyroscope, the identically named property of
CMDeviceMotion
gives aCMRotationRate
structure measuring gyroscope data whose bias has been removed by Core Motion algorithms.Availability
Available in iOS 4.0 and later.
Data Types

The type of structures representing a measurement of rotation rate.
Declaration
Swift
struct CMRotationRate { var x: Double var y: Double var z: Double init() init(x
x
: Double, yy
: Double, zz
: Double) }ObjectiveC
typedef struct { double x; double y; double z; } CMRotationRate
Constants

x
The Xaxis rotation rate in radians per second. The sign follows the right hand rule: If the right hand is wrapped around the X axis such that the tip of the thumb points toward positive X, a positive rotation is one toward the tips of the other four fingers.

y
The Yaxis rotation rate in radians per second. The sign follows the right hand rule: If the right hand is wrapped around the Y axis such that the tip of the thumb points toward positive Y, a positive rotation is one toward the tips of the other four fingers.

z
The Zaxis rotation rate in radians per second. The sign follows the right hand rule: If the right hand is wrapped around the Z axis such that the tip of the thumb points toward positive Z, a positive rotation is one toward the tips of the other four fingers.
Import Statement
ObjectiveC
@import CoreMotion;
Swift
import CoreMotion
Availability
Available in iOS 4.0 and later.

Copyright © 2015 Apple Inc. All rights reserved. Terms of Use  Privacy Policy  Updated: 20100504