feat: 새로운 Navigation Style 적용#88
Conversation
## Walkthrough
이 변경사항은 네비게이션 바 스타일을 유연하게 확장할 수 있도록 하는 프로토콜 및 확장 기능을 도입합니다. 주요 뷰 컨트롤러들이 새로운 스타일 속성을 구현하고, UINavigationController 확장을 통해 스타일 적용 로직이 추가되었습니다. 기존 네비게이션 관련 코드 일부는 제거 또는 단순화되었습니다.
## Changes
| 파일/그룹 | 변경 요약 |
|---|---|
| `BKNavigationBarStylable.swift`, `BaseViewController.swift`, `UINavigationController+.swift` | 네비게이션 바 스타일 확장: 프로토콜(BKNavigationBarStylable) 및 UINavigationController 확장, BaseViewController 프로토콜 채택 및 기본 구현 추가 |
| `LoginViewController.swift`, `HomeViewController.swift`, `SettingViewController.swift` | 각 뷰컨트롤러에 네비게이션 스타일, 타이틀 속성 및 더미 액션 메서드 추가, 기존 타이틀 설정 코드 제거 및 스타일 적용 로직으로 대체 |
| `SceneDelegate.swift` | 네비게이션 바 폰트 및 백버튼 커스텀 코드 제거, 배경색 및 그림자색 설정만 유지, isTranslucent 설정 위치 변경 |
| `BKButton.swift` | SnapKit 제약 조건 클로저 문법을 `$0`으로 간소화 (기능 변화 없음) |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant ViewController
participant UINavigationController
ViewController->>UINavigationController: viewWillAppear()
UINavigationController->>ViewController: conforms to BKNavigationBarStylable?
alt Yes
UINavigationController->>UINavigationController: applyStyleIfNeeded(for: ViewController)
alt Style is .main
UINavigationController->>UINavigationController: set leading title, add search/gear buttons
else Style is .standard
UINavigationController->>UINavigationController: set centered title, add optional right button
end
endAssessment against linked issues
Possibly related PRs
Suggested reviewers
|
75a1bfc to
875e140
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
src/Projects/BKPresentation/Sources/Common/Component/BaseViewController.swift (1)
47-52: 불필요한 타입 캐스팅을 제거하세요.
BaseViewController가 이미BKNavigationBarStylable을 준수하고 있으므로 타입 캐스팅이 불필요합니다.다음과 같이 단순화할 수 있습니다:
- override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - if let _ = self as? BKNavigationBarStylable { - navigationController?.applyStyleIfNeeded(for: self) - } - } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + navigationController?.applyStyleIfNeeded(for: self) + }src/Projects/BKPresentation/Sources/AuthFlow/View/LoginViewController.swift (2)
12-23: 프로토콜 구현이 적절합니다.
BKNavigationBarStylable프로토콜의 구현이 올바르게 되어 있습니다..main스타일 사용도 적절합니다.향후 고려사항:
- 하드코딩된 "로그인" 문자열을 현지화 가능한 형태로 변경하는 것을 고려해보세요
dummyFunc는 플레이스홀더로 보이니 실제 기능 구현 시 적절한 액션으로 교체가 필요합니다
74-74: 플레이스홀더 메서드입니다.
dummyFunc는 현재 빈 구현으로 되어 있습니다. 실제 검색 및 설정 기능 구현 시 적절한 로직으로 교체해야 합니다.실제 네비게이션 액션 구현이 필요할 때 도움을 드릴 수 있습니다.
src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingViewController.swift (2)
15-28: 프로토콜 구현이 올바릅니다.
BKNavigationBarStylable프로토콜의 구현이 적절하며,.standard스타일에 오른쪽 버튼을 활성화한 설정도 올바릅니다.향후 고려사항: "설정" 문자열도 현지화를 고려해보세요.
74-74: 플레이스홀더 메서드의 일관성 있는 사용입니다.다른 뷰 컨트롤러들과 동일한 패턴으로
dummyFunc를 사용하고 있어 일관성이 있습니다.실제 설정 메뉴 액션 구현이 필요할 때 도움을 드릴 수 있습니다.
src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift (1)
56-58: 더미 함수를 실제 구현으로 교체해야 합니다.현재
dummyFunc()가 빈 구현으로 되어 있어 검색 버튼과 설정 버튼이 동작하지 않습니다. 프로덕션 배포 전에 실제 기능을 구현해야 합니다.실제 구현이 필요한 액션들을 구현하는 데 도움이 필요하시면 말씀해 주세요. 검색 기능과 설정 네비게이션을 위한 구현을 제안할 수 있습니다.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/Projects/BKDesign/Sources/Components/Button/BKButton.swift(1 hunks)src/Projects/BKPresentation/Sources/AuthFlow/View/LoginViewController.swift(2 hunks)src/Projects/BKPresentation/Sources/Common/Component/BKNavigationBarStylable.swift(1 hunks)src/Projects/BKPresentation/Sources/Common/Component/BaseViewController.swift(2 hunks)src/Projects/BKPresentation/Sources/Common/Extension/UINavigationController+.swift(1 hunks)src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift(3 hunks)src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingViewController.swift(4 hunks)src/Projects/Booket/Sources/SceneDelegate.swift(1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#56
File: src/Projects/BKPresentation/Sources/Constant/PresentationKeys.swift:3-5
Timestamp: 2025-07-07T13:53:13.006Z
Learning: clxxrlove prefers using enum over struct for constants namespace due to better runtime performance, memory layout, and compiler optimizations. Enum prevents instantiation at compile time without needing private init().
src/Projects/BKPresentation/Sources/Common/Component/BKNavigationBarStylable.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/Booket/Sources/SceneDelegate.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKPresentation/Sources/AuthFlow/View/LoginViewController.swift (2)
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#56
File: src/Projects/BKPresentation/Sources/AuthFlow/ViewModel/LoginViewModel.swift:109-111
Timestamp: 2025-07-07T13:47:32.784Z
Learning: The LoginViewModel's authenticateWithToken case in src/Projects/BKPresentation/Sources/AuthFlow/ViewModel/LoginViewModel.swift is test code and not important for implementation according to the user.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingViewController.swift (2)
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#56
File: src/Projects/BKPresentation/Sources/AuthFlow/ViewModel/LoginViewModel.swift:109-111
Timestamp: 2025-07-07T13:47:32.784Z
Learning: The LoginViewModel's authenticateWithToken case in src/Projects/BKPresentation/Sources/AuthFlow/ViewModel/LoginViewModel.swift is test code and not important for implementation according to the user.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift (4)
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#56
File: src/Projects/BKPresentation/Sources/AuthFlow/ViewModel/LoginViewModel.swift:109-111
Timestamp: 2025-07-07T13:47:32.784Z
Learning: The LoginViewModel's authenticateWithToken case in src/Projects/BKPresentation/Sources/AuthFlow/ViewModel/LoginViewModel.swift is test code and not important for implementation according to the user.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#80
File: src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift:148-148
Timestamp: 2025-07-14T05:23:04.937Z
Learning: Reed-iOS 프로젝트의 BKBottomSheetViewController에서 버튼 영역 높이(84)는 디자인 시스템에 기반한 의도적인 고정값입니다. clxxrlove에 따르면 작은 기기에서도 동일한 크기가 유지되어야 하며, 동적 계산보다는 상수화만 필요합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
src/Projects/BKPresentation/Sources/Common/Extension/UINavigationController+.swift (4)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#80
File: src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift:148-148
Timestamp: 2025-07-14T05:23:04.937Z
Learning: Reed-iOS 프로젝트의 BKBottomSheetViewController에서 버튼 영역 높이(84)는 디자인 시스템에 기반한 의도적인 고정값입니다. clxxrlove에 따르면 작은 기기에서도 동일한 크기가 유지되어야 하며, 동적 계산보다는 상수화만 필요합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Resources/Assets.xcassets/chevron-right.imageset/Contents.json:1-26
Timestamp: 2025-07-08T17:15:59.793Z
Learning: In the BKDesign project, all image assets referenced in Contents.json files are properly included in the repository with the correct 1x, 2x, and 3x variants. The chevron-right icon and other design system icons are complete and ready for use.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
🧬 Code Graph Analysis (3)
src/Projects/BKPresentation/Sources/Common/Component/BaseViewController.swift (2)
src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift (1)
viewWillAppear(31-34)src/Projects/BKPresentation/Sources/Common/Extension/UINavigationController+.swift (1)
applyStyleIfNeeded(43-46)
src/Projects/BKPresentation/Sources/AuthFlow/View/LoginViewController.swift (2)
src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingViewController.swift (1)
dummyFunc(74-74)src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift (1)
dummyFunc(56-58)
src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingViewController.swift (2)
src/Projects/BKPresentation/Sources/AuthFlow/View/LoginViewController.swift (1)
dummyFunc(74-74)src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift (1)
dummyFunc(56-58)
🔇 Additional comments (14)
src/Projects/BKDesign/Sources/Components/Button/BKButton.swift (1)
130-131: SnapKit 구문 개선이 적절하지만 PR 목적과의 연관성을 확인해 주세요.
make파라미터를$0로 축약한 변경사항은 Swift 관례에 맞고, 파일 내 다른 제약 조건들과 일관성을 개선합니다. 하지만 이 변경사항이 네비게이션 스타일 적용이라는 PR의 주요 목적과 어떤 연관이 있는지 명확하지 않습니다.이 변경사항이 PR 범위에 포함된 이유를 확인해 주세요.
src/Projects/BKPresentation/Sources/Common/Component/BKNavigationBarStylable.swift (1)
5-8: 잘 설계된 프로토콜입니다.네비게이션 바 스타일링을 표준화하는 명확하고 간결한 프로토콜 정의입니다. 읽기 전용 프로퍼티로 정의되어 불변성을 보장하며, 의도가 명확합니다.
src/Projects/BKPresentation/Sources/Common/Component/BaseViewController.swift (1)
10-16: 서브클래스 구현 강제를 위한 적절한 설계입니다.
fatalError를 사용하여 서브클래스가 반드시 이 프로퍼티들을 오버라이드하도록 강제하는 것은 추상 베이스 클래스 패턴의 좋은 구현입니다.src/Projects/Booket/Sources/SceneDelegate.swift (1)
67-68: 네비게이션 바 설정이 적절히 단순화되었습니다.새로운
BKNavigationBarStylable시스템으로 인해 기본 설정만 남기고 나머지는 각 뷰 컨트롤러에서 관리하도록 변경된 것이 좋은 접근입니다.isTranslucent = false와largeTitleDisplayMode = .never설정도 적절합니다.src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift (3)
9-16: 네비게이션 바 스타일 구현이 우수합니다.
.main스타일의 구현이 새로운 네비게이션 시스템과 잘 통합되어 있습니다. 연관값을 통한 설정 방식이 깔끔합니다.
26-26: 배경색 변경이 디자인 시스템과 일치합니다.
.bkBaseColor(.primary)사용이 BKDesign 시스템의 일관성을 유지하고 있습니다.
31-34: 네비게이션 스타일 적용 로직이 올바릅니다.
viewWillAppear에서applyStyleIfNeeded(for:)호출이 새로운 네비게이션 시스템의 표준 패턴을 따르고 있습니다.src/Projects/BKPresentation/Sources/Common/Extension/UINavigationController+.swift (7)
6-22: 우수한 네비게이션 스타일 시스템 설계입니다.enum을 사용한 스타일 시스템이 타입 안전하고 확장 가능합니다. 연관값을 통해 각 스타일별 필요한 파라미터를 명확하게 구분한 것이 훌륭합니다.
24-41: StandardRightButton 구조체가 잘 설계되었습니다.기본값 제공과 weak reference 사용으로 메모리 안전성을 확보했습니다. BKImage.Icon.moreVertical을 기본 이미지로 사용한 것도 디자인 시스템과 일관성이 있습니다.
43-46: 프로토콜 기반 스타일 적용 방식이 효과적입니다.
BKNavigationBarStylable프로토콜을 통한 조건부 적용이 안전하고 확장 가능한 구조를 만들었습니다.
114-131: Leading 타이틀 구현이 정교합니다.BKLabel과 BKTextStyle을 사용하여 디자인 시스템과 일관성을 유지하고, SnapKit 제약조건으로 정확한 레이아웃을 구현했습니다.
156-170: 표준 appearance 설정이 완벽합니다.BKDesign 시스템의 색상과 폰트를 일관되게 사용하고, 그림자 제거와 배경색 설정이 적절합니다.
172-183: 백 버튼 커스터마이징이 세심합니다.타이틀 텍스트를 투명하게 처리하고 chevronLeft 아이콘을 사용한 것이 좋습니다.
withAlignmentRectInsets를 통한 정밀한 위치 조정도 훌륭합니다.
133-147: 버튼 스택 구현이 견고합니다.UIStackView를 사용한 버튼 그룹화와 BKSpacing을 통한 일관된 간격 설정이 좋습니다. wrapper view를 통한 여백 처리도 적절합니다.
| override var bkNavigationBarStyle: UINavigationController.BKNavigationBarStyle { | ||
| .main( | ||
| viewController: self, | ||
| target: self, | ||
| searchAction: #selector(dummyFunc), | ||
| gearAction: #selector(dummyFunc) | ||
| ) | ||
| } |
There was a problem hiding this comment.
RightButton config가 variation 가능하게 열려있는게 좋네요 💯
🔗 관련 이슈
📘 작업 유형
📙 작업 내역
BKNavigationBarStylable.swift,UINavigationController+.swift참고BaseViewController와 subclass들이 강제로BKNavigationBarStylable를 구현하도록 변경🧪 테스트 내역
🎨 스크린샷 또는 시연 영상 (선택)
.main.standard.standardwith more button✅ PR 체크리스트
Summary by CodeRabbit
신규 기능
스타일
기타