Singleton for managing CoreMotion ActivityManager and Pedometr
Singleton object for managing CoreMotion methods of user's activity
Simply drag and drop the TrackerManger.swift file to your project
// to check if tracking of activities is possible on your device
TrackerManager.core.checkIfActivityEnabled()
// to check if it's possible to count steps, made by user
TrackerManager.core.checkIfStepsCountEnabled()
// to start monitoring any type of activity just use
TrackerManager.core.startTrackingActivityType(completionHandler: @escaping(CMMotionActivity?)->Void)
// it returns CMMotionActivity, which contains a type of activity (ex. walking, running and so on
// and to stop monitoring
TrackerManager.core.stopPedometr()
TrackerManager.core.stopActivityManager()
// To measure the distance
TrackerManager.core.distance(completionHandler: @escaping(NSNumber?)-> Void)
// To get current pace
TrackerManager.core.currentPace(completionHandler: @escaping(NSNumber?)-> Void)