Please tell me, I can’t save myDate data to a .txt file, which I haven’t tried. I read the accelerometer readings and then output them to the command line, but I want to save
import UIKit import CoreMotion class ViewController: UIViewController { var motionManager = CMMotionManager() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func viewDidAppear(_ animated: Bool) { motionManager.accelerometerUpdateInterval = 1 motionManager.startAccelerometerUpdates(to: OperationQueue.current!) { (data, error) in if let myData = data { //if myData.acceleration.x > 1 //{ print (myData) //} } } }