Skip to content

Commit

Permalink
Crazy idea to improve Observability
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Oct 13, 2023
1 parent b9157a7 commit c914cbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions apple/Sources/FerrostarCore/Location.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public protocol LocationManagingDelegate: AnyObject {

// TODO: Permissions are currently NOT handled and they should be!!!
@Observable
public class LiveLocationManager: NSObject {
public class LiveLocationManager: NSObject, LocationProviding {
public var delegate: LocationManagingDelegate?
public private(set) var authorizationStatus: CLAuthorizationStatus

Expand All @@ -41,9 +41,7 @@ public class LiveLocationManager: NSObject {

locationManager.activityType = activityType
}
}

extension LiveLocationManager: LocationProviding {
public var lastLocation: CLLocation? {
locationManager.location
}
Expand Down Expand Up @@ -84,6 +82,7 @@ extension LiveLocationManager: CLLocationManagerDelegate {
/// Location provider for testing without relying on simulator location spoofing.
///
/// This allows for more granular unit tests.
@Observable
public class SimulatedLocationManager: LocationProviding {
public var delegate: LocationManagingDelegate?
public var lastLocation: CLLocation? {
Expand Down
2 changes: 1 addition & 1 deletion common/build-ios.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/usr/bin/env zsh

set -e
set -u
Expand Down

0 comments on commit c914cbf

Please sign in to comment.