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 : HashableParameters
trackerNew listener
-
Remove a typed tracker from our listeners
Declaration
Swift
func remove<T>(tracker: T) where T : LocationTracker, T : HashableParameters
trackerFormer listener
-
Last calculated distances
Declaration
Swift
private(set) var distances: Distances -
Broadcast to all trackers
Declaration
Swift
func broadcast(then: @escaping (LocationTracker) -> Void)Parameters
thenClosure
-
Broadcast to all trackers
Declaration
Swift
func broadcast(mappable: Mappable, then: @escaping (LocationTracker, Mappable) -> Void)Parameters
mappablePlace
thenClosure
-
Calculate distances
Declaration
Swift
func calculateDistances()
-
willFinishLaunchingWithOptions
Declaration
Swift
func application(_ application: UIApplication, // swiftlint:disable:next discouraged_optional_collection willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> BoolParameters
applicationApplication
launchOptionsLaunch options
Return Value
Success
-
didFinishLaunchingWithOptions
Declaration
Swift
func application(_ application: UIApplication, // swiftlint:disable:next discouraged_optional_collection didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> BoolParameters
applicationApplication
launchOptionsLaunch options
Return Value
Success
-
Updated locations
Declaration
Swift
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])Parameters
managerLocation manager
locationsLocations list
-
Should display heading calibraion
Declaration
Swift
func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> BoolParameters
managerLocation manager
Return Value
true
-
Broadcast authorization change
Declaration
Swift
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus)Parameters
managerLocation manager
statusNew authorization
View on GitHub
LocationHandler Class Reference