title: Get motion sensor data while using camera in iOS
body: <p>I want to be able to record the data from the accelerometer and GPS while also using the camera in my app. The goal is to obtain the accelerometer and GPS data at the exact instant when the photo was taken. I am able to access the sensors and have them continuously record data, but I don't know how to get them to stop recording data at the time the image is captured. I am using Xcode 9 and Swift 4.</p>