diff --git a/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift b/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift index 5e3b73f..95dfd97 100644 --- a/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift +++ b/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift @@ -321,6 +321,12 @@ extension MapViewController: CLLocationManagerDelegate { let recordJourneyViewModel = self.viewModel as? RecordJourneyViewModel else { return } + let previousCoordinate = (self.viewModel as? RecordJourneyViewModel)?.state.previousCoordinate.value + if self.timeRemaining != 0 || viewModel is NavigateMapViewModel { return } + if let previousCoordinate { + if !self.isDistanceOver5AndUnder50(coordinate1: previousCoordinate, + coordinate2: newCurrentLocation.coordinate) { return } + } let coordinate2D = CLLocationCoordinate2D(latitude: newCurrentLocation.coordinate.latitude, longitude: newCurrentLocation.coordinate.longitude) @@ -371,6 +377,7 @@ extension MapViewController: CLLocationManagerDelegate { coordinate2: CLLocationCoordinate2D) -> Bool { let location1 = CLLocation(latitude: coordinate1.latitude, longitude: coordinate1.longitude) let location2 = CLLocation(latitude: coordinate2.latitude, longitude: coordinate2.longitude) + MSLogger.make(category: .navigateMap).log("이동한 거리: \(location1.distance(from: location2))") return 5 <= location1.distance(from: location2) && location1.distance(from: location2) <= 50 } diff --git a/iOS/MusicSpot/MusicSpot/SceneDelegate.swift b/iOS/MusicSpot/MusicSpot/SceneDelegate.swift index d1c0929..a5b7138 100644 --- a/iOS/MusicSpot/MusicSpot/SceneDelegate.swift +++ b/iOS/MusicSpot/MusicSpot/SceneDelegate.swift @@ -12,6 +12,7 @@ import MSConstants import MSData import MSDesignSystem import MSLogger +import MSUserDefaults class SceneDelegate: UIResponder, UIWindowSceneDelegate { @@ -20,7 +21,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? private var appCoordinator: Coordinator! - #if DEBUG @UserDefaultsWrapped(UserDefaultsKey.recordingJourneyID, defaultValue: nil) var recordingJourneyID: String? @UserDefaultsWrapped(UserDefaultsKey.isFirstLaunch, defaultValue: false) @@ -28,6 +28,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { @UserDefaultsWrapped(UserDefaultsKey.isRecording, defaultValue: false) var isRecording: Bool + #if DEBUG var keychain = MSKeychainStorage() #endif @@ -72,12 +73,10 @@ private extension SceneDelegate { } - // MARK: - Debug #if DEBUG import MSKeychainStorage -import MSUserDefaults private extension SceneDelegate {