CMHeadphoneMotionManager
An object that starts and manages headphone motion services.
Declaration
class CMHeadphoneMotionManagerMentioned in
Overview
This class delivers headphone motion updates to your app. Use an instance of the manager to determine if the device supports motion, and to start and stop updates. Adopt the CMHeadphoneMotionManagerDelegate protocol to receive and respond to motion updates. Before using this class, check isDeviceMotionAvailable to make sure the feature is available.
Identify the coordinate axes
To interpret attitude data, you need to know the orientation of the device’s coordinate axes. The following illustration shows the positive x-axis, positive y-axis, and positive z-axis for motion-capable Apple headphones.
[Image]
Topics
Checking Availability
Starting and Stopping Updates
startDeviceMotionUpdates()startDeviceMotionUpdates(to:withHandler:)startConnectionStatusUpdates()stopDeviceMotionUpdates()stopConnectionStatusUpdates()