Using Accelerometer in iOS Applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void ViewDidLoad() | |
{ | |
base.ViewDidLoad(); | |
_motionManager = new CMMotionManager(); | |
_motionManager.StartAccelerometerUpdates(NSOperationQueue.CurrentQueue, (data, error) => | |
{ | |
lblXAxis.Text = data.Acceleration.X.ToString("F"); | |
lblYAxis.Text = data.Acceleration.Y.ToString("F"); | |
lblZAxis.Text = data.Acceleration.Z.ToString("F"); | |
}); | |
// Perform any additional setup after loading the view, typically from a nib. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment