availableAttitudeReferenceFrames()
Returns a bitmask of the available reference frames for reporting the attitude of the current device.
Declaration
class func availableAttitudeReferenceFrames() -> CMAttitudeReferenceFrameReturn Value
A bitmask that you can bitwise-AND with the enum constants of the CMAttitudeReferenceFrame type.
Discussion
When starting a service that allows you to specify a reference frame, it’s your responsibility to specify a reference frame that’s available on the current device. Some reference frames might be unavailable because the required hardware isn’t present or not currently available.
The following example shows how to call this method and test for the availability of the xMagneticNorthZVertical value.
if ([CMMotionManager availableAttitudeReferenceFrames] & CMAttitudeReferenceFrameXMagneticNorthZVertical) {
// do something appropriate here
}