Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.47 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.47 KB

LocationCore

Working singleton for many projects with maximised power of GeoLocation

Installation

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

Useful methods

Start and stop location updates

// to start location updates just use the following method
Location.core.startUpdating()
// if you wanna to stop using location services
Location.core.stopUpdating()

Region monitoring

// to start monitoring any area simply use
 Location.core.monitorNewRegion(_ region: CLCircularRegion)
// and to stop monitoring them
 Location.core.stopMonitorRegion(_ region: CLCircularRegion)

Other

// To get the actual accuracy of geo signal
Location.core.getLocationAccuracy() -> String
// Cases: "No Signal", "Poor Signal", "Average Signal", "Full Signal"
// asuming the values of horizontalAccuracy in comparance with scheme:
// <0(No), >163(Poor) and >48(Average) and other values(Full)

Change configuration and getting values

To change any values of CLLocationManager configuration you should address the core.manager:

// to change activityType
Location.core.manager.activityType = .fitness

Or if you want to get any values from working core:

// gettin' monitors you are monitoring and didn't removed from observation
Location.core.manager.monitoredRegions