Skip to content

Commit

Permalink
Merge pull request #303 from boostcampwm2023/iOS/task/HomeButton-Bug-Fix
Browse files Browse the repository at this point in the history
[iOS] ์‹ค์‹œ๊ฐ„์œผ๋กœ Coordinate ๊ธฐ๋ก ์‹œ ์œ„์น˜ ๏ฟฝํ•„ํ„ฐ๋ง ๊ตฌํ˜„
  • Loading branch information
SwiftyJunnos authored Dec 11, 2023
2 parents 595366e + 7c72619 commit 5ab1859
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down
5 changes: 2 additions & 3 deletions iOS/MusicSpot/MusicSpot/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import MSConstants
import MSData
import MSDesignSystem
import MSLogger
import MSUserDefaults

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

Expand All @@ -20,14 +21,14 @@ 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)
var isFirstLaunch: Bool
@UserDefaultsWrapped(UserDefaultsKey.isRecording, defaultValue: false)
var isRecording: Bool

#if DEBUG
var keychain = MSKeychainStorage()
#endif

Expand Down Expand Up @@ -72,12 +73,10 @@ private extension SceneDelegate {

}


// MARK: - Debug

#if DEBUG
import MSKeychainStorage
import MSUserDefaults

private extension SceneDelegate {

Expand Down

0 comments on commit 5ab1859

Please sign in to comment.