[Feat-T3-132] 설정 화면 구현#32
Conversation
- TableView에서 사용할 수 있는 3가지 타입의 cell 구현 - chevron 이미지로 다음 화면으로 넘어갈 수 있는 cell - button이 있는 cell - switch가 있는 cell
Walkthrough이 변경사항은 설정(Setting) 화면의 전체 구현을 추가하며, 새로운 테이블 뷰 셀 컴포넌트, 헤더 뷰, 커스텀 알럿, 뷰모델, 그리고 디자인 리소스(아이콘 및 에셋)를 도입합니다. 마이페이지의 셀 교체, DI 컨테이너 등록, 네비게이션 바 appearance 개선 등도 포함되어 있습니다. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant SettingView
participant SettingViewModel
participant BitnagilAlert
participant Safari
User->>SettingView: 토글/버튼/체브론 셀 터치
SettingView->>SettingViewModel: action(input:)
SettingViewModel-->>SettingView: Output publisher emit
SettingView->>BitnagilAlert: (필요 시) 알럿 표시
SettingView->>Safari: (필요 시) 외부 URL 오픈
BitnagilAlert-->>SettingView: 버튼 액션 콜백
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
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
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (10)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swift (1)
13-13: 오타 수정이 필요합니다.상수명에 오타가 있습니다:
titleLableLeadingSpacing→titleLabelLeadingSpacing- static let titleLableLeadingSpacing: CGFloat = 20 + static let titleLabelLeadingSpacing: CGFloat = 20그리고 41번 라인에서도 같은 상수명을 수정해야 합니다:
- make.leading.equalToSuperview().offset(Layout.titleLableLeadingSpacing) + make.leading.equalToSuperview().offset(Layout.titleLabelLeadingSpacing)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilToggleTableViewCell.swift (1)
38-41: 사용하지 않는 클로저 매개변수를 처리해주세요.정적 분석 도구에서 지적한 대로,
action매개변수를 사용하지 않으므로_로 대체해주세요.- toggleSwitch.addAction(UIAction { [weak self] action in + toggleSwitch.addAction(UIAction { [weak self] _ inProjects/Presentation/Sources/Common/Component/TableViewCell/BitnagilButtonTableViewCell.swift (3)
11-13: 델리게이트 메서드명을 간소화하세요델리게이트 메서드명이 불필요하게 장황합니다. 이미
BitnagilButtonTableViewCellDelegate프로토콜 내부에 있으므로 메서드명을 간소화할 수 있습니다.protocol BitnagilButtonTableViewCellDelegate: AnyObject { - func bitnagilButtonTableViewCellDidTapButton(_ sender: BitnagilButtonTableViewCell) + func didTapButton(_ sender: BitnagilButtonTableViewCell) }이에 따라 호출 부분도 수정이 필요합니다:
- self.delegate?.bitnagilButtonTableViewCellDidTapButton(self) + self.delegate?.didTapButton(self)
42-42: 일관된 초기화 스타일을 사용하세요
.init대신 타입명을 직접 사용하는 것이 더 명확합니다.- let font = BitnagilFont.init(style: .body2, weight: .semiBold).font + let font = BitnagilFont(style: .body2, weight: .semiBold).font
63-63: 일관된 초기화 스타일을 사용하세요여기서도
.init대신 타입명을 직접 사용하세요.- button.titleLabel?.font = BitnagilFont.init(style: .body2, weight: .semiBold).font + button.titleLabel?.font = BitnagilFont(style: .body2, weight: .semiBold).fontProjects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift (2)
94-96: 앱스토어 열기 구현TODO 주석이 있는 앱스토어 열기 기능을 구현해야 합니다.
앱스토어 열기 기능을 구현하는 코드를 생성해드릴까요? 또는 이 작업을 추적하기 위한 새 이슈를 열어드릴까요?
98-100: 로그아웃 및 회원탈퇴 API 구현로그아웃과 회원탈퇴 API 호출이 구현되어 있지 않습니다.
로그아웃과 회원탈퇴 API 호출을 구현하는 코드를 생성해드릴까요? 인증 관련 로직이 구현되어야 설정 화면이 완전히 작동할 것입니다.
Also applies to: 102-104
Projects/Presentation/Sources/Setting/View/SettingView.swift (3)
183-183: 버전 표시 문자열에 공백을 추가하세요버전 번호 앞에 공백이 없어 가독성이 떨어집니다.
- cell.configure(title: "버전\(version)", buttonTitle: "업데이트", isButtonEnabled: true) + cell.configure(title: "버전 \(version)", buttonTitle: "업데이트", isButtonEnabled: true)- cell.configure(title: "버전\(version)", buttonTitle: "최신", isButtonEnabled: false) + cell.configure(title: "버전 \(version)", buttonTitle: "최신", isButtonEnabled: false)Also applies to: 185-185
190-195: 사용하지 않는 클로저 파라미터를 언더스코어로 교체하세요
isAuthenticated파라미터가 사용되지 않으므로 언더스코어로 교체해야 합니다.viewModel.output.isAuthenticatedPublisher .receive(on: DispatchQueue.main) - .sink(receiveValue: { isAuthenticated in + .sink(receiveValue: { _ in // 로그아웃 완료 후 홈 화면으로 }) .store(in: &cancellables)
339-340: 델리게이트 메서드명 업데이트
BitnagilButtonTableViewCell의 델리게이트 메서드명을 간소화하면 여기도 함께 수정해야 합니다.extension SettingView: BitnagilButtonTableViewCellDelegate { - func bitnagilButtonTableViewCellDidTapButton(_ sender: BitnagilButtonTableViewCell) { + func didTapButton(_ sender: BitnagilButtonTableViewCell) {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
Projects/Presentation/Resources/Images.xcassets/exclamation_filled_icon.imageset/exclamation_filled_icon@1x.pngis excluded by!**/*.pngProjects/Presentation/Resources/Images.xcassets/exclamation_filled_icon.imageset/exclamation_filled_icon@2x.pngis excluded by!**/*.pngProjects/Presentation/Resources/Images.xcassets/exclamation_filled_icon.imageset/exclamation_filled_icon@3x.pngis excluded by!**/*.png
📒 Files selected for processing (13)
Projects/Presentation/Resources/Images.xcassets/exclamation_filled_icon.imageset/Contents.json(1 hunks)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swift(1 hunks)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilButtonTableViewCell.swift(1 hunks)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilChevronTableViewCell.swift(1 hunks)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilToggleTableViewCell.swift(1 hunks)Projects/Presentation/Sources/Common/DesignSystem/BitnagilIcon.swift(1 hunks)Projects/Presentation/Sources/Common/Extension/UIViewController+.swift(1 hunks)Projects/Presentation/Sources/Common/PresentationDependencyAssembler.swift(1 hunks)Projects/Presentation/Sources/Common/View/BitnagilAlert.swift(1 hunks)Projects/Presentation/Sources/MyPage/View/MypageView.swift(4 hunks)Projects/Presentation/Sources/Setting/View/Component/SettingHeaderView.swift(1 hunks)Projects/Presentation/Sources/Setting/View/SettingView.swift(1 hunks)Projects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: choijungp
PR: YAPP-Github/Bitnagil-iOS#19
File: Projects/Presentation/Sources/Common/PresentationDependencyAssembler.swift:0-0
Timestamp: 2025-07-16T10:57:16.559Z
Learning: choijungp는 추후 CustomAlertView를 만들어서 에러 처리를 UI로 해결하도록 수정할 계획을 가지고 있음.
📚 Learning: baseviewcontroller의 viewdidload() 메서드에서 이미 configureattribute(), configurelayout(), bind()를 호출하므로, 하...
Learnt from: choijungp
PR: YAPP-Github/Bitnagil-iOS#19
File: Projects/Presentation/Sources/Login/View/TermsAgreementView.swift:44-46
Timestamp: 2025-07-16T09:09:13.869Z
Learning: BaseViewController의 viewDidLoad() 메서드에서 이미 configureAttribute(), configureLayout(), bind()를 호출하므로, 하위 클래스에서 super.viewDidLoad()를 호출하면 이 메서드들이 자동으로 호출된다. 따라서 하위 클래스에서 추가로 호출할 필요가 없다.
Applied to files:
Projects/Presentation/Sources/MyPage/View/MypageView.swiftProjects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swiftProjects/Presentation/Sources/Setting/View/SettingView.swift
📚 Learning: onboardingrecommendedroutineview에서 viewwillappear에 registeronboarding 호출하는 것이 적절한 이유: 사용자가 이전 페이지에서 ...
Learnt from: choijungp
PR: YAPP-Github/Bitnagil-iOS#19
File: Projects/Presentation/Sources/Onboarding/View/OnboardingRecommendedRoutineView.swift:57-59
Timestamp: 2025-07-16T09:21:15.038Z
Learning: OnboardingRecommendedRoutineView에서 viewWillAppear에 registerOnboarding 호출하는 것이 적절한 이유: 사용자가 이전 페이지에서 온보딩 선택지를 변경한 후 돌아올 때 새로운 선택지로 다시 등록해야 하기 때문. 홈 뷰에서는 이 뷰로 돌아올 수 없어서 중복 호출 문제가 발생하지 않음.
Applied to files:
Projects/Presentation/Sources/MyPage/View/MypageView.swiftProjects/Presentation/Sources/Setting/View/SettingView.swift
🧬 Code Graph Analysis (4)
Projects/Presentation/Sources/Common/PresentationDependencyAssembler.swift (1)
Projects/Shared/Sources/DIContainer/DIContainer.swift (1)
register(14-16)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swift (3)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilChevronTableViewCell.swift (2)
configureAttribute(27-34)configureLayout(36-46)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilButtonTableViewCell.swift (3)
configureAttribute(60-71)configureLayout(73-86)configure(35-58)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilToggleTableViewCell.swift (2)
configureAttribute(33-42)configureLayout(44-55)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilChevronTableViewCell.swift (2)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swift (2)
configureAttribute(32-34)configureLayout(36-43)Projects/Presentation/Sources/Common/DesignSystem/BitnagilIcon.swift (1)
chevronIcon(20-22)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilButtonTableViewCell.swift (2)
Projects/Presentation/Sources/Setting/View/SettingView.swift (1)
bitnagilButtonTableViewCellDidTapButton(340-355)Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swift (3)
configure(28-30)configureAttribute(32-34)configureLayout(36-43)
🪛 SwiftLint (0.57.0)
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilToggleTableViewCell.swift
[Warning] 38-38: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Projects/Presentation/Sources/Setting/View/SettingView.swift
[Warning] 192-192: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Projects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift
[Warning] 95-95: TODOs should be resolved (- 앱스토어 열기)
(todo)
[Warning] 99-99: TODOs should be resolved (- 로그아웃 api)
(todo)
[Warning] 103-103: TODOs should be resolved (- 회원탈퇴 api)
(todo)
🔇 Additional comments (13)
Projects/Presentation/Resources/Images.xcassets/exclamation_filled_icon.imageset/Contents.json (1)
1-23: LGTM!에셋 카탈로그 JSON 파일이 표준 구조를 정확히 따르고 있으며, 모든 필요한 스케일 변형(1x, 2x, 3x)이 적절히 정의되어 있습니다.
Projects/Presentation/Sources/Common/DesignSystem/BitnagilIcon.swift (1)
43-43: LGTM!새로운 아이콘이 기존 패턴을 정확히 따르고 있으며, 적절한 섹션에 배치되어 있습니다.
Projects/Presentation/Sources/Common/PresentationDependencyAssembler.swift (1)
80-82: LGTM!SettingViewModel의 DI 등록이 기존 패턴을 정확히 따르고 있으며, 의존성이 없는 단순한 뷰모델에 적합한 구현입니다.
Projects/Presentation/Sources/Common/Extension/UIViewController+.swift (1)
13-18: 네비게이션 바 외관 설정 개선이 좋습니다.UINavigationBarAppearance를 사용한 일관된 네비게이션 바 스타일링이 잘 구현되었습니다. standardAppearance와 scrollEdgeAppearance 모두에 적용하여 모든 상황에서 일관된 외관을 보장합니다.
Projects/Presentation/Sources/MyPage/View/MypageView.swift (4)
48-48: 명시적 타겟 설정이 좋습니다.UIBarButtonItem의 target을 명시적으로 설정하여 코드의 명확성을 향상시켰습니다.
64-64: 테이블 뷰 셀 리팩토링이 적절합니다.MypageTableViewCell에서 BitnagilChevronTableViewCell로 변경하여 공통 컴포넌트 체계에 맞게 개선되었습니다.
Also applies to: 139-139
68-68: bounces 설정으로 UX 개선.테이블 뷰의 bounces를 false로 설정하여 스크롤이 필요하지 않은 콘텐츠에 대한 사용자 경험을 개선했습니다.
119-122: 설정 화면 네비게이션 구현이 적절합니다.DI 컨테이너를 통한 안전한 의존성 해결과 표준 네비게이션 패턴을 따르는 구현이 좋습니다.
Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilBaseTableViewCell.swift (1)
11-44: 잘 구현된 베이스 클래스입니다.템플릿 메서드 패턴을 사용하여 하위 클래스들이 공통 기능을 재사용할 수 있도록 잘 설계되었습니다.
configureAttribute()와configureLayout()메서드를 통해 확장 가능한 구조를 제공하고 있습니다.Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilChevronTableViewCell.swift (1)
11-47: 베이스 클래스 상속이 올바르게 구현되었습니다.
BitnagilBaseTableViewCell에서 상속받아super.configureAttribute()와super.configureLayout()을 적절히 호출하고 있으며, 셰브론 이미지 설정과 레이아웃이 깔끔하게 구현되었습니다. 기존MypageTableViewCell에서 리팩터링이 성공적으로 이루어졌습니다.Projects/Presentation/Sources/Common/Component/TableViewCell/BitnagilToggleTableViewCell.swift (1)
15-60: 델리게이트 패턴과 메모리 관리가 잘 구현되었습니다.
weak delegate사용과 클로저에서의weak self캡처를 통해 순환 참조를 방지하고 있으며, 토글 상태 변경을 적절히 델리게이트로 전달하고 있습니다. 베이스 클래스 상속도 올바르게 구현되었습니다.Projects/Presentation/Sources/Setting/View/Component/SettingHeaderView.swift (1)
11-67: 섹션 헤더 뷰가 잘 구현되었습니다.
shouldShowDivider매개변수에 따라 구분선 표시 여부와 타이틀 레이블의 top constraint를 동적으로 조정하는 로직이 깔끔하게 구현되었습니다. SnapKit을 사용한 레이아웃 관리와 상수 정의도 일관성 있게 처리되었습니다.Projects/Presentation/Sources/Common/View/BitnagilAlert.swift (1)
11-179: 커스텀 알럿이 잘 구현되었습니다.두 가지 알럿 타입(
withImage,plainText)을 지원하며, 클로저 기반의 버튼 핸들러로 델리게이트 패턴보다 간단하게 처리할 수 있도록 설계되었습니다. 메모리 관리(weak self캡처)와 배경 탭으로 닫기 기능도 적절히 구현되었습니다.이전 학습 내용에 따르면 에러 처리를 위한 CustomAlertView 계획이 있었는데, 이 구현체가 그 목적에 부합하는 것으로 보입니다.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (7)
Projects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift (2)
18-21: 하드코딩된 URL을 환경별로 관리하는 것을 고려하세요현재 이용약관과 개인정보처리방침 URL이 하드코딩되어 있습니다. 향후 개발/스테이징/프로덕션 환경별로 다른 URL을 사용해야 할 수 있으므로 설정 파일이나 환경변수로 관리하는 것을 고려해보세요.
94-105: TODO 주석들에 대한 구현 계획을 명확히 하세요SwiftLint에서 지적된 TODO 주석들이 있습니다. 이들 기능의 구현 우선순위와 일정을 명확히 하거나, 당장 구현하지 않을 경우 이슈로 등록하는 것을 고려해보세요.
특히
logout(),withdrawal(),updateBitnagil()메서드들은 설정 화면의 핵심 기능이므로 구현 계획이 필요합니다.이들 기능의 구체적인 구현을 도와드릴까요? 예를 들어:
- 로그아웃 API 호출 및 토큰 삭제
- 회원탈퇴 API 호출 및 사용자 데이터 정리
- App Store URL 열기
Projects/Presentation/Sources/Setting/View/SettingView.swift (5)
192-194: 사용하지 않는 클로저 매개변수를 언더스코어로 대체하세요SwiftLint에서 지적한 대로 사용하지 않는
isAuthenticated매개변수를_로 대체해야 합니다.- .sink(receiveValue: { isAuthenticated in + .sink(receiveValue: { _ in // 로그아웃 완료 후 홈 화면으로 })
183-185: 버전 문자열 포맷팅에 공백을 추가하세요현재 "버전1.0.0" 형태로 표시되는데, 가독성을 위해 "버전 1.0.0" 형태로 공백을 추가하는 것이 좋겠습니다.
- cell.configure(title: "버전\(version)", buttonTitle: "업데이트", isButtonEnabled: true) + cell.configure(title: "버전 \(version)", buttonTitle: "업데이트", isButtonEnabled: true) - cell.configure(title: "버전\(version)", buttonTitle: "최신", isButtonEnabled: false) + cell.configure(title: "버전 \(version)", buttonTitle: "최신", isButtonEnabled: false)
266-301: 셀 생성 로직이 복잡합니다 - 리팩토링을 고려해보세요현재
cellForRowAt메서드가 매우 복잡합니다. 각 섹션별로 별도의 메서드로 분리하거나, 셀 팩토리 패턴을 도입하는 것을 고려해보세요.private func createCell(for cellStyle: CellStyle, at indexPath: IndexPath) -> UITableViewCell { switch cellStyle { case .toggle(let title): return createToggleCell(title: title, at: indexPath) case .button(let title): return createButtonCell(title: title, at: indexPath) case .chevron(let title): return createChevronCell(title: title, at: indexPath) } }
308-316: 불필요한 UIView 생성을 제거하세요notification 섹션 헤더에서 단순히 공백을 위해 UIView를 생성하는 것보다는 nil을 반환하고 높이만 조정하는 것이 더 효율적입니다.
case .notification: - let view = UIView() - view.backgroundColor = .white - return view + return nil
130-132: 레이아웃 제약 조건에 중복이 있습니다
edges와horizontalEdges가 중복됩니다.edges만 사용하면 됩니다.- make.edges.horizontalEdges.equalToSuperview() + make.edges.equalToSuperview()
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Projects/Presentation/Sources/Setting/View/SettingView.swift(1 hunks)Projects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: choijungp
PR: YAPP-Github/Bitnagil-iOS#19
File: Projects/Presentation/Sources/Common/PresentationDependencyAssembler.swift:0-0
Timestamp: 2025-07-16T10:57:16.559Z
Learning: choijungp는 추후 CustomAlertView를 만들어서 에러 처리를 UI로 해결하도록 수정할 계획을 가지고 있음.
📚 Learning: routinecreationinputview에서 textfield(_:shouldchangecharactersin:replacementstring:) 메서드가 변경 전 텍스트를 d...
Learnt from: taipaise
PR: YAPP-Github/Bitnagil-iOS#25
File: Projects/Presentation/Sources/RoutineCreation/View/Component/RoutineCreationInputView.swift:104-111
Timestamp: 2025-07-27T10:05:46.043Z
Learning: RoutineCreationInputView에서 textField(_:shouldChangeCharactersIn:replacementString:) 메서드가 변경 전 텍스트를 delegate에 전달하는 이유: 변경된 텍스트를 전달하면 텍스트 입력 중에 다른 UI 액션(예: 서브루틴 추가)이 발생할 때 입력 중이던 텍스트가 손실되는 문제가 발생하기 때문. 이는 의도적인 구현으로 동시성 문제를 방지함.
Applied to files:
Projects/Presentation/Sources/Setting/View/SettingView.swift
📚 Learning: onboardingrecommendedroutineview에서 viewwillappear에 registeronboarding 호출하는 것이 적절한 이유: 사용자가 이전 페이지에서 ...
Learnt from: choijungp
PR: YAPP-Github/Bitnagil-iOS#19
File: Projects/Presentation/Sources/Onboarding/View/OnboardingRecommendedRoutineView.swift:57-59
Timestamp: 2025-07-16T09:21:15.038Z
Learning: OnboardingRecommendedRoutineView에서 viewWillAppear에 registerOnboarding 호출하는 것이 적절한 이유: 사용자가 이전 페이지에서 온보딩 선택지를 변경한 후 돌아올 때 새로운 선택지로 다시 등록해야 하기 때문. 홈 뷰에서는 이 뷰로 돌아올 수 없어서 중복 호출 문제가 발생하지 않음.
Applied to files:
Projects/Presentation/Sources/Setting/View/SettingView.swift
📚 Learning: baseviewcontroller의 viewdidload() 메서드에서 이미 configureattribute(), configurelayout(), bind()를 호출하므로, 하...
Learnt from: choijungp
PR: YAPP-Github/Bitnagil-iOS#19
File: Projects/Presentation/Sources/Login/View/TermsAgreementView.swift:44-46
Timestamp: 2025-07-16T09:09:13.869Z
Learning: BaseViewController의 viewDidLoad() 메서드에서 이미 configureAttribute(), configureLayout(), bind()를 호출하므로, 하위 클래스에서 super.viewDidLoad()를 호출하면 이 메서드들이 자동으로 호출된다. 따라서 하위 클래스에서 추가로 호출할 필요가 없다.
Applied to files:
Projects/Presentation/Sources/Setting/View/SettingView.swift
🪛 SwiftLint (0.57.0)
Projects/Presentation/Sources/Setting/View/SettingView.swift
[Warning] 192-192: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Projects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift
[Warning] 95-95: TODOs should be resolved (- 앱스토어 열기)
(todo)
[Warning] 99-99: TODOs should be resolved (- 로그아웃 api)
(todo)
[Warning] 103-103: TODOs should be resolved (- 회원탈퇴 api)
(todo)
🔇 Additional comments (5)
Projects/Presentation/Sources/Setting/ViewModel/SettingViewModel.swift (2)
34-34: 과거 리뷰 코멘트의 오타가 수정되었습니다이전 리뷰에서 지적된
udpate->update오타가 정상적으로 수정되었습니다.
70-70: 과거 리뷰 코멘트의 메서드명 오타가 수정되었습니다이전 리뷰에서 지적된
togglelPushNotification->togglePushNotification오타가 정상적으로 수정되었습니다.Also applies to: 88-88
Projects/Presentation/Sources/Setting/View/SettingView.swift (3)
349-349: 과거 리뷰 코멘트의 오타가 수정되었습니다이전 리뷰에서 지적된
.udpate->.update오타가 정상적으로 수정되었습니다.
221-242: 알럽 설정이 잘 구현되었습니다CustomAlertView를 사용한 로그아웃과 회원탈퇴 확인 알럽이 잘 구현되었습니다. 이전 학습 내용에서 언급된 CustomAlertView 사용 계획이 잘 반영되었네요.
109-112: BaseViewController 패턴을 올바르게 사용하고 있습니다이전 학습 내용에 따르면 BaseViewController의 viewDidLoad()에서 이미 필요한 메서드들을 호출하므로, viewWillAppear에서 네비게이션 바만 설정하는 현재 구현이 올바릅니다.
choijungp
left a comment
There was a problem hiding this comment.
SettingView가 똒똒한 이유는 알림, 정보, 계정 요로케 분기처리 해야 해서 그른거죠 ???
그럼 어쩔 수 없는 것 같어요 .. (현재 상황에서는 ...ResultRecommendedRoutineView 애도 너무너무 똑똑함 ....... but 개선해야죠 )
완존 추후 확장성 + 재사용성을 고려한 PR인 것 같슴니다 !!!!!
완고 띵동 !!!!!!!!!! 👍🏻 띵푸루부
| self?.cancelHandler?() | ||
| self?.dismiss(animated: false) |
There was a problem hiding this comment.
여기서 dismiss까지 처리하려고 delegate가 아닌 closure로 해주신건가요 !!!??!?
There was a problem hiding this comment.
Delegate로 구현해도 버튼의 액션 내부에서 결국 dismiss()를 호출했을 것 같아요! (물론, 제가 모르는 제한이 없다면요.)
클로저 방식으로 구현한 이유는, alert를 호출하는 ViewController에서 여러 종류의 alert를 띄울 수 있기 때문입니다!
Delegate를 쓰면 취소/확인 버튼 탭 시 모두 동일한 delegate 메서드로 들어오게 되는데, 이 때마다 “지금 뜬 alert가 로그아웃인지, 탈퇴인지”를 분기해야 하는 문제가 있었습니다. 그리고 분기를 위해서는 AlertView역시 본인이 어떤 Alert인지에 대한 정보를 가지고 있고, delegate 실행 시 해당 값을 넘겨주어야 합니다. (예: alert 생성 시에 alertId 같은 값을 전달해서, delegate 실행 시 id값을 넘기고, 위임받은 객체에서 id를 기반으로 분기)
이렇게 분기처리하는 것보다는, 클로저로 각 alert에 필요한 로직을 직접 넘겨주는 편이 더 유연하고 직관적이라고 생각했어요!
🌁 Background
📱 Screenshot
설정
alert
👩💻 Contents
📝 Review Note
커스텀 alert 화면 구현
tableViewCell 커스텀
MypageTableViewCell의 이름을BitnagilBaseTableViewCell로 수정했습니다.BitnagilBaseTableViewCell은 단순하게 cell의 Title 부분만 표시하도록 구현되어 있습니다.BitnagilBaseTableViewCellBitnagilButtonTableViewCellDelegate: 우측에 버튼이 있다. 추후 앱스토어 업데이트 리디렉션 구현할 때 사용할 예정BitnagilChevronTableViewCell: 우측에 chevron 이미지가 있다. 주로 다음 화면이나 웹 페이지로 이동할 때 사용됨BitnagilToggleTableViewCellDelegate: UISwitch가 우측에 위치. 켜고 끌 수 있다. (toggle)매직 넘버(Magic Number) 없이 TableView 조작하기
tableViewDatasource의 메서드나tableViewDelegate메서드 내에서 switch를 통한 분기처리가 많이 들어가 코드가 길어지는 부분이 있습니다. 하지만 매직 넘버 없이 Section과 Row를 명확하게 관리할 수 있어, 유지보수에는 더 유리하다고 판단했습니다.Setting View가 조금 똑똑해요 ㅠ
Summary by CodeRabbit
신규 기능
개선 사항
버그 수정