다음을 통해 공유


CMDeviceMotionHandler 대리자

정의

이벤트를 받는 데 사용되는 대리자 서명 CMMotionManager

public delegate void CMDeviceMotionHandler(CMDeviceMotion motion, NSError error);
type CMDeviceMotionHandler = delegate of CMDeviceMotion * NSError -> unit

매개 변수

motion
CMDeviceMotion

이 이벤트에 대한 디바이스 동작(디바이스의 태도, 회전 속도 및 가속)입니다.

error
NSError

오류(있는 경우) 또는 보고할 오류가 없는 경우 null입니다.

설명

이 서명은 의 StartDeviceMotionUpdates에 대한 인수 CMMotionManager로 사용됩니다.

예를 들면 다음과 같습니다.

var motionManager = new CMMotionManager ();
motionManager.AccelerometerUpdateInterval = 0.01; // 100Hz
motionManager.StartDeviceMotionUpdates (NSOperationQueue.CurrentQueue, (motion, error) => {
     Console.WriteLine ("RotationRate={0} Gravity={1} UserAcceleration={2} Attitude={3}", motion.RotationRate, motion.Gravity, motion.UserAcceleration, motion.Attitude);
});

적용 대상