-
Notifications
You must be signed in to change notification settings - Fork 6
[Feat] #214 - 코스그리기 및 업로드 팝업 추가 #221
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
The head ref may contain hidden characters: "#214-\uCF54\uC2A4\uADF8\uB9AC\uAE30\uBC0F\uC5C5\uB85C\uB4DC"
Conversation
thingineeer
left a comment
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.
그래도 같이 고민해 본 적이 있어서 그런지, 코드는 잘 읽히네요 ㅎ
| enum AlertType { | ||
| case defaultType | ||
| case custom | ||
| } | ||
|
|
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.
OCP 원칙 잘 지킨거 좋네요
| } | ||
|
|
||
| private func presentServiceAlertVC() { | ||
| let requestLocationServiceAlert = UIAlertController(title: "위치 정보 이용", message: "위치 서비스를 사용할 수 없습니다.\n디바이스의 '설정 > 개인정보 보호'에서\n위치 서비스를 먼저 켜주세요.", preferredStyle: .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.
'설정 > 개인정보 보호'에서\n위치 서비스를 먼저 켜주세요. 부분에서
'위치 서비스' 와 같이 작은따옴표를 추가하는 건 어떠신가요!? 🫠
| private func presentAlertVC() { | ||
| let alertVC = RNAlertVC(description: "위치 접근을 허용해야 사용할 수 있어요.\n[설정] - [애플리케이션] - [위치접근]을\n허용해 주세요.") | ||
| alertVC.modalPresentationStyle = .overFullScreen | ||
| alertVC.alertType = .custom | ||
|
|
||
| alertVC.leftButtonTapAction = { | ||
| alertVC.dismiss(animated: false) | ||
| self.navigationController?.popViewController(animated: true) | ||
| } | ||
| alertVC.rightButtonTapAction = { | ||
| if let url = URL(string: UIApplication.openSettingsURLString) { | ||
| UIApplication.shared.open(url) | ||
| alertVC.dismiss(animated: false) | ||
| } | ||
| self.navigationController?.popViewController(animated: true) | ||
| } | ||
|
|
||
| self.present(alertVC, animated: false) | ||
| } |
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.
두 알람의 alpha를 통일 시켜보는 것이 어떠신지 궁금합니다~ 🫠
현재 RNAlert의 속성만 변경 가능하다면 같은 뷰이니, 통일했으면 좋겠습니다!
그게 아니라면 다른 곳에서도 변경이 되어버리니,, 메모 해놓고 차후에 수정하면 좋을 것 같습니다
아니면 이참에 모든 background alpha를 통일해 보는 것도 좋을 지도..?
RNAlertVC 같은 경우
extension RNAlertVC {
private func setUI() {
view.backgroundColor = .black.withAlphaComponent(0.8)
containerView.backgroundColor = .w1
}
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.
좋아요~~~ 이거 코어타임때 이야기 해봅시다~
Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift
Show resolved
Hide resolved
| DispatchQueue.global().async { [weak self] in | ||
| guard let self = self else { return } | ||
| if CLLocationManager.locationServicesEnabled() { | ||
| switch authorizationStatus { | ||
| case .notDetermined ,.restricted ,.denied: | ||
| DispatchQueue.main.async { | ||
| self.presentAlertVC() | ||
| } | ||
| default: | ||
| DispatchQueue.main.async { | ||
| self.naviBar.showKeyboard() | ||
| } | ||
| } | ||
| } else { | ||
| DispatchQueue.main.async { | ||
| self.presentServiceAlertVC() | ||
| } | ||
| } | ||
| } |
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.
아마 비동기 로직을 바꾸지 않는 이상은 속도 변화가 없을 것 같긴 한데, 그래도 구조 같은 경우 만 본다면 if ~ else
대신 guard let 을 한 번 더 쓰면 아래와 같이 작성을 할 수 있을 것 같네요. 🫠
DispatchQueue.global().async { [weak self] in
guard let self = self else { return }
guard CLLocationManager.locationServicesEnabled() else {
DispatchQueue.main.async {
self.presentServiceAlertVC() // 전체 위치 서비스
}
return
}
switch authorizationStatus {
case .notDetermined, .restricted, .denied:
DispatchQueue.main.async {
self.presentAlertVC() // 러넥트 위치 서비스
}
default:
DispatchQueue.main.async {
self.naviBar.showKeyboard()
}
}
}
마지막으로 후손들을 위해 주석 다는 건 어떻게 생각하시는지 궁금하네요~ㅎ
제가 위에 남겨놓은 두 개 정도!? 🔥
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.
남겨주신 코드 감사합니다 ! 이렇게 바꾸는게 나을 것 같아요 👍🏻
그리고 적절한 주석 달아두는 것도 좋은 것 같네요 ㅎ 간략하게 주석 추가해두겠습니다 ~!
| let latitude: Double | ||
| let longitude: Double |
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.
< 코스 생성 api 관련 바뀐 부분> @thingineeer
- RNLocationModel lat, long명 바뀜
- path 바뀜
- 보내줄때 name이 바뀜
let formData = MultipartFormData(provider: .data(jsonData), name: "courseCreateRequestDto", mimeType: "application/json")
마지막 커밋 확인 부탁드립니다 !!
thingineeer
left a comment
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.
어렵게 오래 코딩했는데, 다 지우는게 맘 아픕니다..
하지만 어떤 부분이든, 많이 성장 했을거라 믿습니다
|
|
||
| let jsonData = try JSONSerialization.data(withJSONObject: content) | ||
| let formData = MultipartFormData(provider: .data(jsonData), name: "data", mimeType: "application/json") | ||
| let formData = MultipartFormData(provider: .data(jsonData), name: "courseCreateRequestDto", mimeType: "application/json") |
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.
name: "courseCreateRequestDto" 이 부분이 의미하는바가 뭔지 알 수 있을까요??
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.
| guard let self = self else { return } | ||
| courseProvider.request(target: .uploadCourseDrawing(param: requestDto), instance: BaseResponse<CourseDrawingResponseData>.self, vc: self) { response in | ||
| LoadingIndicator.hideLoading() | ||
| switch response { | ||
| case .success(let result): | ||
| let status = result.statusCode | ||
| if 200..<300 ~= status { | ||
| do { | ||
| let responseDto = try result.map(BaseResponse<CourseDrawingResponseData>.self) | ||
| guard let data = responseDto.data else { return } | ||
| self.presentAlertVC(courseId: data.id) | ||
| } catch { | ||
| print(error.localizedDescription) | ||
| } | ||
| } | ||
| if status >= 400 { | ||
| print("400 error") | ||
| self.showNetworkFailureToast() | ||
| } | ||
| case .failure(let error): | ||
| if let response = error.response { | ||
| if let responseData = String(data: response.data, encoding: .utf8) { | ||
| print(responseData) | ||
| } | ||
| } else { | ||
| print(error.localizedDescription) | ||
| } | ||
| } | ||
| guard let data = response.data else { return } | ||
| self.presentAlertVC(courseId: data.id) |
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.
이 부분 변경된 서버 통신 함수 사용해서 수정해뒀습니다
api 연결 작업할 일 또 생기면 참고하시면 될 것 같아요!!
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.
고생하셨습니다~~~


🌱 작업한 내용
🌱 PR Point
문제 : 분기처리를 해주다보니 키보드 올라오는 속도가 좀 느려요 (...) 고민입니다 ..
📸 스크린샷
📮 관련 이슈