I am starting to build an augmented reality app where you can place an image on the screen on your augmented reality camera view and it stays in that position on the Earth,
Swift 3
Gyroscope code update:
import CoreMotion
...
motionManager.deviceMotionUpdateInterval = 0.1
motionManager.startDeviceMotionUpdates(to: OperationQueue.current!) { deviceManager, error in
guard let dm = deviceManager else { return }
let roll = dm.attitude.roll
let pitch = dm.attitude.pitch
let yaw = dm.attitude.yaw
print("r: \(roll), p: \(pitch), y: \(yaw)")
}