Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.26 KB

README.md

File metadata and controls

52 lines (35 loc) · 1.26 KB

TrackerManager

Singleton for managing CoreMotion ActivityManager and Pedometr

Singleton object for managing CoreMotion methods of user's activity

Installation

Simply drag and drop the TrackerManger.swift file to your project

Useful methods

Start and stop location updates

// 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()

Activity monitoring

// 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()

Other

// To measure the distance
TrackerManager.core.distance(completionHandler: @escaping(NSNumber?)-> Void)
// To get current pace 
TrackerManager.core.currentPace(completionHandler: @escaping(NSNumber?)-> Void)