Converted the MotionManager Class into SWIFT