From 4e93f9734f7daec4b8a769ca1d4d1141c7b4ea1e Mon Sep 17 00:00:00 2001 From: Zach Date: Wed, 20 Dec 2023 16:34:58 -0700 Subject: [PATCH] Fix issues with LocationApplication (#10) --- .../LocationApplication/LocationApplication.swift | 1 - .../ApplicationKit/LocationApplication/LocationManager.swift | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/ApplicationKit/LocationApplication/LocationApplication.swift b/Sources/ApplicationKit/LocationApplication/LocationApplication.swift index 5bfd954..42ce024 100644 --- a/Sources/ApplicationKit/LocationApplication/LocationApplication.swift +++ b/Sources/ApplicationKit/LocationApplication/LocationApplication.swift @@ -25,7 +25,6 @@ open class LocationApplication: LifecyleApplication, CLLocationManagerDelegate { open func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { } open func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { } open func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) { } - open func locationManager(_ manager: CLLocationManager, didUpdateTo newLocation: CLLocation, from oldLocation: CLLocation) { } open func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) { } open func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) { } open func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) { } diff --git a/Sources/ApplicationKit/LocationApplication/LocationManager.swift b/Sources/ApplicationKit/LocationApplication/LocationManager.swift index eb4ccf0..c94f723 100644 --- a/Sources/ApplicationKit/LocationApplication/LocationManager.swift +++ b/Sources/ApplicationKit/LocationApplication/LocationManager.swift @@ -1,7 +1,7 @@ import AppState import CoreLocation -fileprivate extension Application { +private extension Application { var coreLocationManager: Dependency { dependency(CLLocationManager()) } @@ -9,7 +9,7 @@ fileprivate extension Application { /// A class that wraps around a CLLocationManager instance from AppState's Application singleton. open class LocationManager { - @AppDependency(\.coreLocationManager) private var manager: CLLocationManager + @AppDependency(\.coreLocationManager) public var manager: CLLocationManager /// The delegate object to receive update events. public var delegate: CLLocationManagerDelegate? {