feat: 하단 탭 바 구현#105
Conversation
|
""" Walkthrough이번 변경 사항에서는 기존의 메인 플로우를 대체하는 새로운 하단 탭바 네비게이션 UI를 도입했습니다. 이를 위해 TabBarCoordinator와 BottomTabBarController를 추가하고, ArchiveCoordinator 및 관련 뷰 컨트롤러를 신설했습니다. 기존 MainTabBarController는 삭제되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant AppCoordinator
participant TabBarCoordinator
participant BottomTabBarController
participant MainFlowCoordinator
participant ArchiveCoordinator
participant ArchiveTempViewController
AppCoordinator->>TabBarCoordinator: start()
TabBarCoordinator->>BottomTabBarController: 생성 및 탭 설정
TabBarCoordinator->>MainFlowCoordinator: 홈 탭 Coordinator 생성 및 시작
TabBarCoordinator->>ArchiveCoordinator: 아카이브 탭 Coordinator 생성 및 시작
ArchiveCoordinator->>ArchiveTempViewController: 뷰 컨트롤러 생성 및 푸시
AppCoordinator->>TabBarCoordinator: onFinish 시 startAuthFlow() 호출
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–25 minutes Suggested labels
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
ac64aa8 to
0aabcde
Compare
+ cornerRadius와 shadow 동시 적용하기 위한 처리 추후 작업 예정
0aabcde to
c04deca
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
src/Projects/BKPresentation/Sources/TabBarFlow/TabItem.swift (1)
10-15: 하드코딩된 문자열을 로컬라이제이션 시스템으로 대체하는 것을 고려해보세요.현재 title 속성에서 한국어 문자열을 직접 반환하고 있어 다국어 지원이 어려울 수 있습니다. NSLocalizedString이나 프로젝트의 로컬라이제이션 시스템을 사용하는 것을 권장합니다.
var title: String { switch self { - case .home: return "홈" - case .archive: return "내 서재" + case .home: return NSLocalizedString("tab.home.title", value: "홈", comment: "Home tab title") + case .archive: return NSLocalizedString("tab.archive.title", value: "내 서재", comment: "Archive tab title") } }src/Projects/BKPresentation/Sources/ArchiveFlow/ArchiveTempViewController.swift (1)
18-29: 접근성 지원을 추가하는 것을 고려해보세요.현재 라벨에 접근성 속성이 설정되어 있지 않습니다. 향후 실제 구현 시 접근성을 고려해주세요.
let label = UILabel() label.text = "내 서재 화면" label.textAlignment = .center + label.accessibilityLabel = "내 서재 화면" + label.accessibilityTraits = .staticText label.translatesAutoresizingMaskIntoConstraints = falsesrc/Projects/BKPresentation/Sources/TabBarFlow/BottomTabBarController.swift (1)
101-101: 하드코딩된 색상값 대신 디자인 시스템을 사용하세요.그림자 색상이 직접 hex 값으로 하드코딩되어 있습니다. 일관성을 위해 BK 디자인 시스템의 색상을 사용하는 것을 권장합니다.
- customLayer.shadowColor = UIColor(hex: "6D6D6D").cgColor + customLayer.shadowColor = UIColor.bkContentColor(.tertiary).cgColorsrc/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift (1)
56-56: 불필요한 빈 줄 제거를 고려해 주세요.코드의 일관성을 위해 불필요한 빈 줄을 제거하는 것을 고려해 주세요.
-
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/Projects/BKPresentation/Sources/AppCoordinator.swift(2 hunks)src/Projects/BKPresentation/Sources/ArchiveFlow/ArchiveCoordinator.swift(1 hunks)src/Projects/BKPresentation/Sources/ArchiveFlow/ArchiveTempViewController.swift(1 hunks)src/Projects/BKPresentation/Sources/MainFlow/MainTabBarController.swift(0 hunks)src/Projects/BKPresentation/Sources/TabBarFlow/BottomTabBarController.swift(1 hunks)src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift(1 hunks)src/Projects/BKPresentation/Sources/TabBarFlow/TabItem.swift(1 hunks)
💤 Files with no reviewable changes (1)
- src/Projects/BKPresentation/Sources/MainFlow/MainTabBarController.swift
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/Projects/BKPresentation/Sources/AppCoordinator.swift (1)
src/Projects/BKPresentation/Sources/Common/Coordinator/Coordinator.swift (1)
addChildCoordinator(39-44)
src/Projects/BKPresentation/Sources/TabBarFlow/BottomTabBarController.swift (2)
src/Projects/BKDesign/Sources/Extensions/UIColor+.swift (4)
bkBaseColor(91-102)bkContentColor(52-63)bkBackgroundColor(38-50)bkBorderColor(65-76)src/Projects/BKDesign/Sources/Components/Button/BKButtonSize.swift (1)
cornerRadius(111-120)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (15)
src/Projects/BKPresentation/Sources/TabBarFlow/TabItem.swift (1)
17-22: 아이콘 속성 구현이 적절합니다.BKImage.Icon을 통한 아이콘 참조가 일관성 있게 구현되어 있고, enum 케이스와 아이콘이 명확하게 매핑되어 있습니다.
src/Projects/BKPresentation/Sources/ArchiveFlow/ArchiveTempViewController.swift (1)
14-29: 임시 구현으로서 적절한 구조입니다.기본적인 UI 설정과 SnapKit을 이용한 제약조건 설정이 올바르게 구현되어 있습니다. 향후 실제 Archive 기능 구현 시 이 구조를 기반으로 확장하면 될 것 같습니다.
src/Projects/BKPresentation/Sources/AppCoordinator.swift (2)
32-33: 임시 변경사항인지 확인이 필요합니다.인증 실패 시에도 메인 플로우로 이동하도록 변경되었는데, 이것이 개발/테스트를 위한 임시 변경인지 확인해주세요. 프로덕션에서는 인증 실패 시 적절한 인증 플로우로 이동해야 합니다.
실제 프로덕션 배포 전에 이 변경사항을 되돌려야 하는지 확인해주세요:
case .failure: -// self?.startAuthFlow() - self?.startMainFlow() + self?.startAuthFlow()
54-64: TabBarCoordinator로의 전환이 올바르게 구현되었습니다.MainFlowCoordinator에서 TabBarCoordinator로의 변경이 일관성 있게 이루어졌고, coordinator 패턴을 올바르게 따르고 있습니다. 변수명 변경과 메서드 호출도 적절합니다.
src/Projects/BKPresentation/Sources/ArchiveFlow/ArchiveCoordinator.swift (3)
18-22: 애니메이션 없이 뷰 컨트롤러를 푸시하는 이유를 확인해보세요.
animated: false로 설정되어 있는데, 탭 전환 시의 UX를 고려할 때 이것이 의도된 동작인지 확인이 필요합니다.탭바 초기 설정 시에는 애니메이션이 없는 것이 맞을 수 있지만, 일반적인 네비게이션에서는 애니메이션이 있는 것이 더 자연스러울 수 있습니다. 이것이 의도된 동작인지 확인해주세요.
5-16: Coordinator 패턴이 올바르게 구현되었습니다.표준 Coordinator 프로토콜을 준수하며, 필요한 속성들이 적절히 선언되고 초기화되었습니다. parentCoordinator의 weak 참조도 올바르게 설정되어 있습니다.
25-28: 미래 확장을 위한 좋은 구조입니다.extension을 통해 Archive 관련 네비게이션 메서드들을 추가할 수 있도록 구조를 준비해둔 것이 좋습니다.
src/Projects/BKPresentation/Sources/TabBarFlow/BottomTabBarController.swift (3)
80-94: 베지어 패스 구현이 잘 되어 있습니다.상단 모서리의 둥근 처리를 위한 베지어 패스가 정확하게 구현되어 있고, PR 목표에서 언급한 대로 좌표 파라미터들이 가독성을 위해 한 줄로 유지되어 있습니다.
36-47: 탭바 appearance 설정이 체계적으로 구현되었습니다.UITabBarAppearance를 사용한 설정이 잘 구조화되어 있고, BK 디자인 시스템의 색상을 적절히 활용하고 있습니다.
14-22: 네비게이션 바 숨김/표시 처리가 적절합니다.탭바 컨트롤러가 표시될 때 네비게이션 바를 숨기고, 사라질 때 다시 표시하는 로직이 올바르게 구현되어 있습니다.
src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift (5)
6-20: 클래스 구조와 초기화가 잘 구현되었습니다.Coordinator 패턴을 올바르게 구현했고, weak reference로 부모 coordinator를 참조하여 retain cycle을 방지했습니다. 의존성 주입 패턴도 적절히 사용되었습니다.
27-54: 탭 설정 로직이 잘 구현되었습니다.각 탭에 대해 독립적인 navigation controller와 coordinator를 설정하는 패턴이 올바르게 구현되었습니다. Child coordinator 관리도 적절히 처리되었습니다.
57-63: 탭 아이템 설정이 적절히 구현되었습니다.디자인 시스템 색상을 사용하여 일관성을 유지하고, normal/selected 상태에 대한 색상 처리가 올바르게 되었습니다.
67-75: Child coordinator 관리가 올바르게 구현되었습니다.Identity comparison(!=)을 사용한 coordinator 제거 로직이 적절하고, 표준 coordinator 패턴을 잘 따르고 있습니다.
22-25: 네비게이션 패턴 검토 요청현재 AppCoordinator의 startMainFlow에서 동일한 UINavigationController에 TabBarController를 push하도록 구현되어 있습니다. 이 경우 이전 로그인 화면이 네비게이션 스택에 남아 있을 수 있으니, 의도된 동작인지 확인해 주세요.
만약 “로그인 → 메인” 전환 시 스택을 초기화하거나 모달로 처리하는 것이 필요하다면, 다음 방안을 고려해 보십시오:
- navigationController.pushViewController(tabBarController, animated: true) 대신
navigationController.setViewControllers([tabBarController], animated: true) 사용- 또는 UIWindow의 rootViewController를 BottomTabBarController로 직접 설정
- 필요 시 모달 present 방식으로 전환
검토 위치:
- src/Projects/BKPresentation/Sources/AppCoordinator.swift — func startMainFlow()
- src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift — func start()
clxxrlove
left a comment
There was a problem hiding this comment.
일단 코디네이터만 리뷰했습니다. 나머지는 이따 볼게요.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift (1)
57-57: 불필요한 빈 줄을 제거해주세요.코드 일관성을 위해 불필요한 빈 줄을 제거하는 것이 좋겠습니다.
-
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Projects/BKPresentation/Sources/AppCoordinator.swift(1 hunks)src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Projects/BKPresentation/Sources/AppCoordinator.swift
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#105
File: src/Projects/BKPresentation/Sources/TabBarFlow/BottomTabBarController.swift:24-30
Timestamp: 2025-07-24T13:00:59.096Z
Learning: doyeonk429는 BottomTabBarController에서 viewDidLayoutSubviews의 레이어 재생성 방식을 유지하기를 선호합니다. 탭바에서는 레이아웃 변경 케이스가 거의 없기 때문에 성능 최적화보다는 현재의 단순한 구현 방식이 더 적합하다고 판단합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:124-133
Timestamp: 2025-07-10T08:21:49.399Z
Learning: doyeonk429는 테스트 전용으로만 사용되는 extension이나 코드는 해당 테스트 파일에 그대로 두는 것을 선호합니다. 실제 프로덕션 코드에서 사용되지 않는 테스트 전용 코드는 별도 파일로 분리하지 않고 테스트 파일 내에 유지하는 것이 그들의 코드 구성 방식입니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#98
File: src/Projects/BKPresentation/Sources/AuthFlow/View/TermsView.swift:78-85
Timestamp: 2025-07-22T05:37:28.756Z
Learning: doyeonk429는 Reed-iOS 프로젝트에서 더미 데이터나 테스트 데이터의 구체적인 내용(예: URL 주소)에 대해서는 리뷰 시 지적하지 않기를 선호한다. 더미 데이터는 임시적이며 실제 기능 구현 시 교체될 예정이므로 URL의 구체적인 주소는 중요하지 않다고 본다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:38-48
Timestamp: 2025-07-08T17:17:40.046Z
Learning: doyeonk429는 BKDesign 프로젝트에서 다크모드 지원 코드를 미래를 위한 사전 준비 코드로 구현하고 있다. 현재 다크모드 디자인이 없어서 모든 다크모드 분기에서 라이트모드 색상을 반환하도록 의도적으로 구현했으며, 나중에 다크모드 디자인이 완성되면 해당 케이스만 구현하면 되는 구조로 설계했다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#98
File: src/Projects/BKPresentation/Sources/AuthFlow/View/TermsViewController.swift:3-5
Timestamp: 2025-07-22T05:39:10.746Z
Learning: doyeonk429는 Reed-iOS 프로젝트에서 UI 구현 단계에서 미래의 기능 연결을 위해 필요한 import들을 미리 추가해두는 방식을 선호한다. 현재 사용되지 않더라도 곧 사용될 예정인 라이브러리들은 제거하지 않고 유지하는 것을 원한다.
src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift (1)
Learnt from: doyeonk429
PR: #105
File: src/Projects/BKPresentation/Sources/TabBarFlow/BottomTabBarController.swift:24-30
Timestamp: 2025-07-24T13:00:59.096Z
Learning: doyeonk429는 BottomTabBarController에서 viewDidLayoutSubviews의 레이어 재생성 방식을 유지하기를 선호합니다. 탭바에서는 레이아웃 변경 케이스가 거의 없기 때문에 성능 최적화보다는 현재의 단순한 구현 방식이 더 적합하다고 판단합니다.
🧬 Code Graph Analysis (1)
src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift (2)
src/Projects/BKPresentation/Sources/Common/Coordinator/Coordinator.swift (2)
addChildCoordinator(39-44)didFinish(18-25)src/Projects/BKDesign/Sources/Extensions/UIColor+.swift (2)
bkBackgroundColor(38-50)bkContentColor(52-63)
🔇 Additional comments (6)
src/Projects/BKPresentation/Sources/TabBarFlow/TabBarCoordinator.swift (6)
6-11: 클래스 구조가 올바르게 구현되었습니다.Coordinator 패턴을 올바르게 따르고 있으며, weak reference를 사용하여 retain cycle을 방지하고 있습니다. 캡슐화도 적절히 적용되어 있습니다.
14-21: 초기화 메서드가 적절히 구현되었습니다.의존성 주입 패턴을 올바르게 사용하고 있으며, 모든 필수 프로퍼티가 적절히 초기화되고 있습니다.
23-26: start 메서드가 깔끔하게 구현되었습니다.책임 분리가 잘 되어 있고, 애니메이션을 사용하여 사용자 경험을 고려한 네비게이션을 제공합니다.
28-55: 탭 바 설정이 올바르게 구현되었습니다.각 탭에 대해 별도의 네비게이션 컨트롤러를 생성하고, 자식 코디네이터를 적절히 관리하고 있습니다. 코디네이터 패턴을 잘 따르고 있습니다.
58-64: 탭 아이템 설정이 적절히 구현되었습니다.enum을 활용한 구성과 프로젝트의 디자인 시스템을 사용한 컬러 테마 적용이 잘 되어 있습니다. 선택/비선택 상태에 대한 시각적 피드백도 적절합니다.
68-73: 세션 만료 처리가 올바르게 구현되었습니다.네비게이션 스택을 완전히 정리하고 didFinish()를 호출하여 코디네이터를 적절히 정리하는 로직이 잘 구현되어 있습니다.
🔗 관련 이슈
📘 작업 유형
📙 작업 내역
🧪 테스트 내역
🎨 스크린샷 또는 시연 영상 (선택)
✅ PR 체크리스트
💬 추가 설명 or 리뷰 포인트 (선택)
Summary by CodeRabbit
신규 기능
기타