-
Notifications
You must be signed in to change notification settings - Fork 1
[FIX] 2.1.0 QA 관련 작업 및 취향탐색 여부에 따른 네비게이션 분기처리 (#248) #252
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.
고생하셨습니다! 리뷰 확인 부탁드려요!
| UserDefaults.standard.set(true, | ||
| forKey: StringLiterals.UserDefaults.hasVerifiedArea) |
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.
🐿️ 줄바꿈 굳이 안 해도 될 것 같아요!
| hasVerifiedArea ? hasPreference ? NavigationUtils.navigateToTabBar() : NavigationUtils.naviateToLoginOnboarding() : NavigationUtils.navigateToOnboardingLocalVerification() | ||
|
|
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 setXButtonAction() { | ||
| let currentVC = pages[currentIndex] | ||
|
|
||
| if currentVC is SpotUploadSearchViewController { | ||
| setXButton(#selector(showQuitAlert)) | ||
| } else { | ||
| setXButton(#selector(navigateToTabBar)) | ||
| } | ||
| } | ||
|
|
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.
🐿️ SearchVC일 때만 Alert을 띄우는 이유가 궁금합니다!
이후 페이지에서도 동일하게 Alert을 띄워주는 편이 자연스럽지 않을까요?
🐿️🐿️🐿️
그리고 182, 193줄에서, 페이지가 넘어갈 때마다 이 메소드를 호출하시는 이유가 궁금합니다
setXButton 코드를 살펴보면 add된 액션을 remove하는 로직 없이 addTarget만 되는데,
그러면 페이지를 이동할 때마다 action이 쌓이게 되어,
결국 x버튼에 showQuitAlert과 navigateToTabBar 액션이 모두 등록될 것 같아서요.
혹시 제가 잘못 생각한거라면 설명해주시면 감사하겠습니다...!!!!
// BaseNavViewController
func setXButton(_ action: Selector? = nil) {
setButtonStyle(button: leftButton, image: .icXmark)
guard let action else {
setButtonAction(button: leftButton,
target: self,
action: #selector(xButtonTapped))
return
}
setButtonAction(button: leftButton,
target: self,
action: action)
}
func setButtonAction(button: UIButton, target: Any, action: Selector) {
button.addTarget(target, action: action, 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.
여러 번 중첩되는 거 맞는 것 같아요 ! 우선 다음과 같이 수정하겠습니다
private func setXButtonAction() {
let currentVC = pages[currentIndex]
leftButton.removeTarget(nil, action: nil, for: .touchUpInside)
if currentVC is SpotUploadSearchViewController {
setXButton(#selector(showQuitAlert))
} else {
setXButton(#selector(navigateToTabBar))
}
}
SearchVC에서만 알럿 띄우는 걸로 피그마를 이해했는데, 기획 측에 한 번 더 물어볼게요 ~
| NotificationCenter.default.addObserver( | ||
| self, | ||
| selector: #selector(appWillEnterForeground), | ||
| name: UIApplication.willEnterForegroundNotification, | ||
| object: nil | ||
| ) |
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.
🐿️🐿️ 글래스모피즘 렌더링에 대해 많이 고민하고 해결책을 찾으신 것 같아요!! 최고👍👍
그런데 NotificationCenter에 옵저버를 등록하는 코드가 여러번 중복되는 것 같아요..!
ViewController extension에 아래처럼 메소드를 만들어서 self랑 @objc 코드만 입력해도 되도록 하면 어떨까요?
func addForegroundObserver(target: Any, action: Selector) {
NotificationCenter.default.addObserver(target, selector: action, name: UIApplication.willEnterForegroundNotification, object: nil)
}그리고 혹시 deinit 코드를 BaseVC에 넣어두는 건 위험하려나요.....?
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.
좋은 제안 감사합니다 !!! target: Any로 하면 안 돼서 다음과 같이 정의했습니다 ㅎㅎ
func addForegroundObserver(action: Selector) {
NotificationCenter.default.addObserver(self, selector: action, name: UIApplication.willEnterForegroundNotification, object: nil)
}
BaseVC에 deinit 넣는 것도 반영했습니다 ! 문서에 따르면 자식 뷰컨의 deinit이 먼저 호출된 뒤, 부모 뷰컨의 deinit이 무조건 호출된다고 하네요
🐿️ Pull Requests
🪵 작업 브랜치
🥔 작업 내용
장소 등록 (네이버 API) 관련
hasPreference (취향탐색 여부) 추가 및 네비게이션 로직 분기처리
글라스모피즘 렌더링 오류 잡기 : 앱 재진입 시 하얗게 뜨는 오류 해결
🚨 참고 사항
앱 재진입 시 글라스모피즘 렌더링 오류 잡는 걸 GlassmorphismView나 BaseVC / BaseNavVC로 빼고 싶었는데, 또 뺴면 적용이 안 되더라고요..? 우선 각 뷰에 직접 해놓고 조금 더 연구해보겠습니다 !!
💥 To be sure
🌰 Resolve issue