LocationHandler
class LocationHandler : NSObject, AppHandler, ServiceProvider
extension LocationHandler: AppLaunchHandler
extension LocationHandler: CLLocationManagerDelegate
Handle things to do on location changes
-
Application’s locationManager instance
Declaration
Swift
var locationManager: CLLocationManager
-
Last coordinate measured
Declaration
Swift
var lastCoordinate: CLLocation?
-
Last location contained in
Declaration
Swift
var lastInside: Int?
-
Insert a typed tracker in our listeners
Declaration
Swift
func insert<T>(tracker: T) where T : LocationTracker, T : Hashable
Parameters
tracker
New listener
-
Remove a typed tracker from our listeners
Declaration
Swift
func remove<T>(tracker: T) where T : LocationTracker, T : Hashable
Parameters
tracker
Former listener
-
Last calculated distances
Declaration
Swift
private(set) var distances: Distances
-
Broadcast to all trackers
Declaration
Swift
func broadcast(then: @escaping (LocationTracker) -> Void)
Parameters
then
Closure
-
Broadcast to all trackers
Declaration
Swift
func broadcast(mappable: Mappable, then: @escaping (LocationTracker, Mappable) -> Void)
Parameters
mappable
Place
then
Closure
-
Calculate distances
Declaration
Swift
func calculateDistances()
-
willFinishLaunchingWithOptions
Declaration
Swift
func application(_ application: UIApplication, // swiftlint:disable:next discouraged_optional_collection willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
Parameters
application
Application
launchOptions
Launch options
Return Value
Success
-
didFinishLaunchingWithOptions
Declaration
Swift
func application(_ application: UIApplication, // swiftlint:disable:next discouraged_optional_collection didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
Parameters
application
Application
launchOptions
Launch options
Return Value
Success
-
Updated locations
Declaration
Swift
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
Parameters
manager
Location manager
locations
Locations list
-
Should display heading calibraion
Declaration
Swift
func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool
Parameters
manager
Location manager
Return Value
true
-
Broadcast authorization change
Declaration
Swift
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus)
Parameters
manager
Location manager
status
New authorization