Created
April 25, 2020 23:38
-
-
Save aheze/7dbfe664308cd1998f163e91cd26a2e4 to your computer and use it in GitHub Desktop.
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
/// This is how often we will get device motion updates | |
/// 0.03 is more than often enough and is about the rate that the video frame changes! | |
motionManager.deviceMotionUpdateInterval = 0.03 | |
motionManager.startDeviceMotionUpdates(to: .main) { | |
[weak self] (data, error) in | |
guard let data = data, error == nil else { | |
return | |
} | |
/// This function will be called every 0.03 seconds | |
self?.updateHighlightOrientations(attitude: data.attitude) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment