Skip to content

Singleton for managing CoreMotion ActivityManager and Pedometr

License

Notifications You must be signed in to change notification settings

drougojrom/TrackerManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Singleton for managing CoreMotion ActivityManager and Pedometr

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages