-
Notifications
You must be signed in to change notification settings - Fork 2
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
[fix] 1차 QA 반영 #364
[fix] 1차 QA 반영 #364
Conversation
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.
고생하셨어요~
if let moveTime = formatter.date(from: moveStartTime.value) { | ||
let calendar = Calendar.current | ||
|
||
let moveTimeComponents = calendar.dateComponents([.hour, .minute], from: moveTime) | ||
let currentTimeComponents = calendar.dateComponents([.hour, .minute], from: Date()) | ||
|
||
if let moveHour = moveTimeComponents.hour, let moveMinute = moveTimeComponents.minute, | ||
let currentHour = currentTimeComponents.hour, let currentMinute = currentTimeComponents.minute { | ||
if currentHour > moveHour || (currentHour == moveHour && currentMinute > moveMinute) { | ||
self.isLate.value = true | ||
} else { | ||
self.isLate.value = false | ||
} | ||
} | ||
} | ||
case .ready: | ||
if let readyTime = formatter.date(from: readyStartTime.value) { | ||
let calendar = Calendar.current | ||
|
||
let readyTimeComponents = calendar.dateComponents([.hour, .minute], from: readyTime) | ||
let currentTimeComponents = calendar.dateComponents([.hour, .minute], from: Date()) | ||
|
||
if let readyHour = readyTimeComponents.hour, let readyMinute = readyTimeComponents.minute, | ||
let currentHour = currentTimeComponents.hour, let currentMinute = currentTimeComponents.minute { | ||
if currentHour > readyHour || (currentHour == readyHour && currentMinute > readyMinute) { | ||
self.isLate.value = true | ||
} else { | ||
self.isLate.value = 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.
공통되는 부분은 메서드로 분리할 수 있을 것 같아요.
'DRY'라고 'Don't Repeat Yourself'인데, 개발 시 동일한 코드를 반복하지 말라라는 뜻입니다.
viewModel.promiseInfo.bindOnMain(with: self) { owner, model in | ||
owner.rootView.myReadyStatusProgressView.isUserInteractionEnabled = (model?.isParticipant ?? 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.
괄호는 삭제 해도 괜찮지 않을까요?
// MARK: - UICollectionViewDelegateFlowLayout | ||
|
||
extension PromiseInfoViewController: UICollectionViewDelegateFlowLayout { | ||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { |
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.
이 부분은 메서드가 너무 길기 때문에 개행해도 좋을 것 같네요.
🔗 연결된 이슈
📄 작업 내용
👀 기타 더 이야기해볼 점