Last active
October 29, 2020 19:01
-
-
Save aheze/0200630955433ab67385065284784abc 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
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() | |
/// viewDidLoad() is often too early to get the first initial attitude, so we use viewDidLayoutSubviews() instead | |
if let currentAttitude = motionManager.deviceMotion?.attitude { | |
/// we populate initialAttitude with the current attitude | |
initialAttitude = currentAttitude | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment