Skip to content

Instantly share code, notes, and snippets.

@aheze
Last active April 25, 2020 23:41
Show Gist options
  • Save aheze/de8651439a566053c2214c060c7cfa3a to your computer and use it in GitHub Desktop.
Save aheze/de8651439a566053c2214c060c7cfa3a to your computer and use it in GitHub Desktop.
//MARK: Motion (Accelerometer and Gyroscope)
/// motionManager will be what we'll use to get device motion
var motionManager = CMMotionManager()
/// this will be the "device’s true orientation in space" (Source: https://nshipster.com/cmdevicemotion/)
var initialAttitude: CMAttitude?
/// we'll later read these values to update the highlight's position
var motionX = Double(0) /// aka Roll
var motionY = Double(0) /// aka Pitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment