Please answer in Swift 4+
Basically what I want the user to do is the following. Run App.Phone records whats in front of it. Change in CoreMotion data. Yesor No Prompt pops up. No continues the recording. Yes saves thevideo.
import UIKit
import AVKit
import MobileCoreServices
//imports for accelerometer below
import CoreMotion
class ViewController: UIViewController,UIImagePickerControllerDelegate, UINavigationControllerDelegate{
//accelerometer code begins here:
var motion = CMMotionManager()
@IBOutlet weakvar RecordButton: UIButton!
override func viewDidLoad(){
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*func myAccelerometer(){
motion.accelerometerUpdateInterval = 0.25
motion.startAccelerometerUpdates(to:OperationQueue.current!) { (data, error) in
print(data as Any)
if let trueData = data {
self.view.reloadInputViews()
let x = trueData.acceleration.x
let y = trueData.acceleration.y
let z = trueData.acceleration.z
let totalAcceleration = calculateMagnitude (no1:Float (x),no2: Float (y),no3: Float (z))
if
PayPal Gateway not configured
PayPal Gateway not configured