// Created by dasdom on 10.12.19. // Copyright © 2019 dasdom. All rights reserved. // import UIKit import CoreMotion import LogStore class ViewController: UIViewController { let motionManager = CMMotionManager() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. startMotionUpdates() } func startMotionUpdates() { motionManager.deviceMotionUpdateInterval = 1 / 60 motionManager.startDeviceMotionUpdates( using: .xArbitraryZVertical, to: OperationQueue()) { motion, error in guard let motion = motion else { return } printLog("motion: \(motion)") } } }