-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#144] 로딩뷰에서 기본 로딩 시간 없애기 #146
Conversation
.alert(isPresented: $showingLoadingAlert) { | ||
Alert( | ||
title: Text("Error!"), | ||
message: Text(alertMessage), | ||
dismissButton: .default(Text("Okay")) { | ||
} | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떤 Alert인가요 ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로딩이 무한으로 돌 경우에 그냥 로딩을 중단하고 알러트를 주기 위해서 작성햤어요
.onAppear { | ||
journeyModel.journeyStops = [] | ||
locationManager.remainingStops = 0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 작업이 필요한 이유가 뭔가용 ~?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
계산이 완료되었다는 판단을 remainingstops 이 변수를 통해서 하고 있는데 이게 초기화를 안해주면 계산됐는지 확인하는데 정확도가 떨어져서요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
각 모델에서 변수 선언할 때, 빈 배열 / 0 값으로 초기화 되어 생성되도록 했는데도 정확도가 떨어지나용 ..?
어떤 부분에서 정확도가 떨어지는 건지 궁금해요 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트를 해봤는데 저 두 변수가 초기화가 되지 않더라구요?
예를 들어 207 경로를 한번 탄다음 다시 새로운 버스를 타려고 스크린샷을 등록해서 start를 누르면 이전의 값이 노출되는 에러가 있었어요. 제가 remainingStops 를 이용하는데, 기존 값이 있으면 이미 계산이 완료되었다고 판단되어 로딩이 넘어가기 때문에 이 코드를 넣었습니다.
사실 이 코드를 저도 쓰면서 이게 맞나라는 생각이 들기는 했는데요..! 한번 사용자가 버스 탑승을 완료했을때 변수들이 잘 초기화 되고있는지 전반적인 점검이 필요할 것 같아요. 혹시 이 부분에서 짐작가는 문제점이 있으실까요..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 ! 두번째로 경로를 등록했을 때가 문제군요.
아마 리셋하는 로직이 없어서 그런 거 같아요~
이번에는 이렇게 진행하고 경로가 끝난 시점에 리셋 작업을 진행하도록 추가 작업해야 할 것 같습니다!
private func startLoadingTimeout() { | ||
DispatchQueue.main.asyncAfter(deadline: .now() + 15.0) { | ||
if isLoading { | ||
stopLoadingWithError("Failed to load the image. Please try again.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러 메세지가 의미하는 게 무엇인지 모르겠어요 🥲
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로딩이 15초 이상 지속되면 사용자에게 다시 시도해보라는 에러를 주고 싶었어요. 무한으로 기다리게 할 수 없어서요
private func stopLoadingWithError(_ message: String) { | ||
isLoading = false | ||
alertMessage = message | ||
showingLoadingAlert = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로딩뷰를 멈추기 위해 꼭 error alert을 보내야 하는 건가요 ~~??...
어렵군요 ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 첨부된 스크린샷 영상을 봐도 헷갈리실까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 ! 정상 동작 영상만 봐서 몰랐어요!
헉 저두 작업 속도 느려서 할 말 없듬 ㅎㅎㅎ. ..... 아자자 ~! |
private func stopLoadingWithError(_ message: String) { | ||
isLoading = false | ||
alertMessage = message | ||
showingLoadingAlert = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 ! 정상 동작 영상만 봐서 몰랐어요!
@@ -10,6 +10,7 @@ import SwiftUI | |||
struct BusStopArrivalView: View { | |||
@EnvironmentObject var imageHandler: ImageHandlerModel | |||
@EnvironmentObject var journeyModel: JourneySettingModel | |||
@EnvironmentObject var locationManager: LocationManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 뷰에서 location manager가 사용되지 않는 것 같은데 선언해둔 이유가 있나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드를 수정하다가 실수로 추가된 것 같아요. 고쳐놓을게요!
.onAppear { | ||
journeyModel.journeyStops = [] | ||
locationManager.remainingStops = 0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
각 모델에서 변수 선언할 때, 빈 배열 / 0 값으로 초기화 되어 생성되도록 했는데도 정확도가 떨어지나용 ..?
어떤 부분에서 정확도가 떨어지는 건지 궁금해요 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
📝 작업 내용
스크린샷
KakaoTalk_Video_2025-01-03-16-49-13.mp4
ScreenRecording_01-03-2025.16-40-10_1.MP4
💬 리뷰 요구사항 (선택)