-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] 2.0 업로드 UI (#142) #145
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
Conversation
yurim830
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.
자잘한 리뷰 남겼습니다! 고생하셨어요
| reviewFinishedView.finishedReviewLabel.do { | ||
| $0.setLabel(text: spotName.abbreviatedString(9) + StringLiterals.Upload.finishedReview, | ||
| style: .t2SB, | ||
| alignment: .center) | ||
| } |
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.
🐿️ 다른 뷰에서는 bind 메소드로 label 등을 세팅하는 구조로 가고 있는데
FinishedVC에서는 label에 직접 접근해서 세팅하셨네요! 이렇게 하신 이유가 있나요?
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.
bind가 필요없던 기존 코드를 고치는 방식으로 작업해서 그런 것 같습니다 !
DropAcornVC에서도 다음과 같이 되어있는데, 구조상 bind을 적용하는 게 책임 분리 면에서 좋긴 하겠지만, 간단하다 보니 구태여 bind을 적용하는 게 좋을지는 고민이 되네요..🧐 어떻게 생각하시나요?
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.
크게 문제되는 부분은 아니어서 편하신 방향으로 작성하셔도 좋을 것 같습니다!
만약 저라면 코드 구조 통일 + 책임 분리를 위해 bind를 사용할 것 같긴 합니다!
| private let finishedReviewLabel: UILabel = UILabel() | ||
| var finishedReviewLabel: UILabel = UILabel() |
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.
🐿️ VC에서 접근하기 위해 private을 제거한 건 이해했습니다! 그런데 let으로 선언해도 충분히 vc에서 수정 가능할 것 같아요
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 searchSuggestionCollectionViewFlowLayout: UICollectionViewFlowLayout = { | ||
| let layout = LeftAlignedCollectionViewFlowLayout() | ||
| layout.do { | ||
| $0.scrollDirection = .vertical | ||
| $0.minimumInteritemSpacing = 8 | ||
| $0.minimumLineSpacing = 8 | ||
| $0.sectionInset = UIEdgeInsets(top: 10, left: ScreenUtils.widthRatio*16, bottom: 10, right: ScreenUtils.widthRatio*16) | ||
| $0.estimatedItemSize = CGSize(width: 100, height: 38) | ||
| } | ||
| return layout | ||
| }() |
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.
🐿️ 아래처럼 then 클로저를 사용하면 코드 길이를 줄일 수 있을 것 같습니다!
let searchSuggestionCollectionViewFlowLayout = UICollectionViewFlowLayout().then {
$0.scrollDirection = .vertical
...
}
| ACLocationManager.shared.checkUserDeviceLocationServiceAuthorization() | ||
| // TODO: - 임시방편으로 asyncAfter, 타이밍 문제 고치기 | ||
| DispatchQueue.main.asyncAfter(deadline: .now()+0.05) { | ||
| self.spotSearchViewModel.getSearchSuggestion() | ||
| } |
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.
🐿️🐿️ 현재 권한체크 로직이 백그라운드에서 실행되고 있어서 해당 문제가 있는 것 같아요. 메인스레드에서 실행되도록 수정하면 타이밍 이슈가 자연스럽게 해결될 수 있을 것 같습니다..! 권한 체크는 무거운 로직이 아니어서 괜찮을 것 같은데 어떠신가요?
그리고 checkUserDeviceLocationServiceAuthorization() 메소드를 getSearchSuggestion() 내부로 포함시키는 것도 고려해볼 수 있을 것 같습니다!
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.
저도 권한체크 자체가 무거운 로직이 아닌 거에는 동의하지만, 아예 다른 방식으로 ACLocationManager을 리팩할 수 있을 것 같기도 해서 메인 스레드로 가져오는 거는 좀 고민을 해봐야 할 것 같아요 !
일단 이 문제는 isLocationReady라는 ObservablePattern을 추가해서, 위치가 로드되었을 때 getSearchSuggestion을 호출하도록 해서 해결해두겠습니당
checkUserDeviceLocationServiceAuthorization() 메소드를 getSearchSuggestion() 내부로 포함시키는 것도 고려해볼 수 있을 것 같습니다!
이거는 뷰모델의 위경도 프로퍼티를 업데이트하는 checkUserDeviceLocationServiceAuthorization()이 특정 서버통신 함수 안에 들어간 건 구조상 어색한 것 같아서 패스하겠습니다 !!
| self.rightButton.addTarget(self, | ||
| action: #selector(nextButtonTapped), | ||
| for: .touchUpInside) |
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.
🐿️ 버튼 이름이 rightButton이니까 메소드 이름을 nextButtonTapped -> rightButtonTapped 로 수정하면 어떨까요?
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.
아 이것도 고민이 되는 지점인데, BaseNavVC의 rightButton을 가져다가 다음버튼을 만든 거라
명칭의 통일성을 포기하더라고, 로직 이해하기 편하게 nextButtonTapped으로 명명했습니다.
명칭의 통일성을 가져가는 rightButtonTapped이 더 낫다고 생각하시나요? 👀
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.
흠. 그런 의도시라면 goToNext와 같은 네이밍은 어떠신가요?
🐿️ Pull Requests
🪵 작업 브랜치
🥔 작업 내용
2.0 업로드 UI를 작업했습니다.
🚨 참고 사항
🆘를 단 주석들은 이번 스프린트 안에 수정할 예정입니다 !
현재 위치도 안 맞고, 도토리도 없어서 (아직 리뷰 업로드 API 수정 전 - 도토리 없으면 리뷰 업로드 못함) 다음 코드들을 적용한 뒤 시뮬 영상 촬영했습니다. 이 때문에 시뮬 영상에서는 "도토리소반"을 입력해 다음으로 넘어가며, 원래라면 실제 기획 의도대로 잘 작동됩니다. (커밋에는 적용되지 않음!)
String+에 말줄임표를 적용해주는 abbreviatedString 메소드 추가했습니다.
ACTextField 수정사항
1. doneButton 프로퍼티를 추가하여 필요한 경우에만 키보드 위 "완료" 버튼이 뜨도록 했습니다.
2. ACTextField에 글라스모피즘을 적용하는 setGlassmorphism 메소드를 추가했습니다.
📸 스크린샷
💥 To be sure
🌰 Resolve issue