Documentation

MotionController

A Swift Controller Class that handles interaction with Core Motion libraries.

To access CoreMotion data, make sure to include NSMotionUsageDescription key-values in the application Info.plist. Not doing so will crash the app at runtime.

Usage

Start motion activity updates, if possible given the current device model:

do {
    let controller = MotionController()
    try? controller.startMotionActivityUpdates()
}

Notes

  • MotionController will need be modified to externalize updates depending on your use case. To get you started, motion changes are logged to console.