diff --git a/ProjectClock/MathExpressions.swift b/ProjectClock/MathExpressions.swift index 5a8171a..b59eb30 100644 --- a/ProjectClock/MathExpressions.swift +++ b/ProjectClock/MathExpressions.swift @@ -6,6 +6,7 @@ // import Foundation +import CoreMotion /** Math element for problem generation (Credit: https://stackoverflow.com/a/43132311/7346633) @@ -196,3 +197,17 @@ class RPS { } */ } + +class Shake { + var motionManager = CMMotionManager() + + func viewDidAppear(_ animated: Bool) { + motionManager.accelerometerUpdateInterval = 0.2 + + motionManager.startAccelerometerUpdates(to: OperationQueue.current!) { (data,error) in + if let myData = data { + print(myData) + } + } + } +}