Skip to content

Conversation

@youz2me
Copy link
Member

@youz2me youz2me commented Sep 24, 2025

👻 PULL REQUEST

📄 작업 내용

  • SceneDelegate, LoginViewController에 코디네이터 패턴을 적용헸어요.

✅ 이번 PR에서 이런 부분을 중점적으로 체크해주세요!

잠깐 확인하고 갈까요?
  • 들여쓰기를 5번 이하로 준수했는지, 코드 가독성이 적절한지 확인해주세요.

  • 한 줄당 120자 제한을 준수했는지 확인해주세요.

  • MARK 주석이 정해진 순서와 형식에 맞게 작성되었는지 확인해주세요.

  • 반복되는 상수 값이 있는지, 있다면 Constant enum으로 분리되어 있는지 확인해주세요.

  • 삼항 연산자가 길어질 경우 적절히 개행되어 있는지 확인해주세요.

  • 조건문에서 중괄호가 올바르게 사용되었는지 확인해주세요.

  • 라이브러리 import가 퍼스트파티와 서드파티로 구분되고 알파벳순으로 정렬되었는지 확인해주세요.

  • 용량이 큰 리소스나 호출되지 않을 가능성이 있는 프로퍼티에 lazy var가 적절히 사용되었는지 확인해주세요.

  • 메모리 누수 방지를 위한 weak 참조가 필요한 곳에 적용되었는지 확인해주세요.

  • 도메인 로직과 UI 로직이 적절히 분리되어 있는지 확인해주세요.

🔗 연결된 이슈

Summary by CodeRabbit

  • 신기능
    • 로그인 진입 시 온보딩 안내 시트가 표시되어 사용자가 확인 후 온보딩으로 이동합니다.
    • 온보딩 및 홈 화면이 전체 화면 전환으로 표시되어 몰입감이 향상됩니다.
  • 리팩터링
    • 로그인 흐름을 코디네이터 기반으로 재구성하여 내비게이션 바를 숨기고 전환 동작을 일관되게 개선했습니다.

@youz2me youz2me requested review from JinUng41 and Copilot September 24, 2025 13:28
@youz2me youz2me self-assigned this Sep 24, 2025
@youz2me youz2me added ♻️ refactor 기존 코드를 리팩토링하거나 수정하는 등 사용 (생산적인 경우) 🦉 유진 🛌🛌🛌🛌🛌🛌🛌🛌🛌🛌 labels Sep 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

프로젝트에 LoginCoordinator를 추가하고, SceneDelegate에서 로그인 초기화 흐름을 코디네이터 패턴으로 전환했다. LoginViewController는 내부 네비게이션 메서드를 제거하고 외부 콜백(클로저) 기반으로 전환됐다. Xcode 프로젝트 설정에 신규 Swift 파일이 빌드 타깃과 그룹에 포함됐다.

Changes

Cohort / File(s) Summary
Project wiring
Wable-iOS.xcodeproj/project.pbxproj
LoginCoordinator.swift 파일 레퍼런스/빌드파일 추가, Login 그룹에 포함, Sources 빌드 페이즈에 컴파일 대상으로 등록
App entry refactor
Wable-iOS/App/SceneDelegate.swift
loginCoordinator 프로퍼티 도입, 루트를 숨김 내비게이션 컨트롤러로 교체, LoginCoordinator.start()로 로그인 플로우 시작
New coordinator
Wable-iOS/Presentation/Login/LoginCoordinator.swift
LoginCoordinator 추가: navigationController/childCoordinators, start()에서 LoginViewControllerLoginViewModel 주입 및 콜백 바인딩, 온보딩 시트→LCKYearViewController 모달, 홈은 TabBarController 풀스크린 모달
Login VC callbackization
Wable-iOS/Presentation/Login/LoginViewController.swift
navigateToOnboarding/navigateToHome 옵셔널 클로저 추가 및 호출부 변경, 기존 내부 네비게이션 메서드 제거

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App as App
  participant Scene as SceneDelegate
  participant Nav as UINavigationController
  participant Coord as LoginCoordinator
  participant LVC as LoginViewController
  participant Sheet as WableSheetViewController
  participant OnbNav as UINavigationController (hidden)
  participant Onb as LCKYearViewController(.flow)
  participant Home as TabBarController

  App->>Scene: willConnect
  Scene->>Nav: 생성(네비바 hidden)
  Scene->>Coord: 생성(navigationController: Nav)
  Scene->>Coord: start()
  Coord->>LVC: 생성(LoginViewModel 주입,<br/>navigateToOnboarding / navigateToHome 할당)
  Coord->>Nav: LVC push
  note over LVC,Coord: 로그인 화면 표시

  LVC-->>Coord: navigateToOnboarding()
  Coord->>Sheet: 생성(타이틀/메시지, 액션 등록)
  Coord->>Nav: Sheet present (modal)
  Sheet-->>Coord: 액션 탭
  Coord->>OnbNav: 생성(root: Onb, hidden)
  Coord->>Nav: OnbNav present (fullScreen)

  LVC-->>Coord: navigateToHome()
  Coord->>Home: 생성
  Coord->>Nav: Home present (fullScreen)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues Check ✅ Passed 링크된 이슈 #278의 요구사항은 "로그인 코디네이터 패턴 적용"으로 단순하며 PR은 LoginCoordinator 추가, SceneDelegate에서의 coordinator 사용 전환, LoginViewController의 네비게이션 콜백화 등으로 해당 목표를 직접적으로 구현하고 있어 연결된 이슈의 목적을 충족합니다.
Out of Scope Changes Check ✅ Passed 변경 파일들은 LoginCoordinator 추가, SceneDelegate 및 LoginViewController의 리팩터와 프로젝트 파일(pbxproj)에 대한 파일 등록으로 한정되어 있어 제공된 이슈 범위를 벗어나는 별도의 기능 추가나 무관한 수정은 식별되지 않습니다.
Title Check ✅ Passed 제목 "[Refactor] 로그인 화면 코디네이터 적용"은 PR의 핵심 변경인 로그인 화면에 코디네이터 패턴을 적용한 리팩터를 간결하고 명확하게 요약하고 있어 변경사항과 잘 일치합니다; 불필요한 세부나 이모지가 없고 한눈에 주요 목적을 파악할 수 있습니다.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#278-login-coordinator

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@youz2me youz2me changed the title [Refactor] 로그인 화면 코디네이터 적용 [Refactor] 로그인 화면 코디네이터 패턴 적용 Sep 24, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the login screen to implement the coordinator pattern by introducing a LoginCoordinator that manages navigation responsibilities previously handled directly by the LoginViewController.

  • Extracted navigation logic from the view controller into a dedicated coordinator
  • Modified the SceneDelegate to use the coordinator for initializing the login screen
  • Introduced closure-based communication between the view controller and coordinator

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
LoginViewController.swift Removed navigation methods and replaced with closure properties for coordinator communication
LoginCoordinator.swift New coordinator class implementing navigation logic extracted from the view controller
SceneDelegate.swift Updated to instantiate and use the LoginCoordinator instead of directly creating the LoginViewController
project.pbxproj Added the new LoginCoordinator.swift file to the project

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


func showHome() {
let tabBarController = TabBarController()
tabBarController.modalPresentationStyle = .fullScreen
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modalPresentationStyle should be set consistently. In showOnboarding() it's set on line 37, but here it's set separately. Consider extracting this common configuration or ensuring consistent patterns across both methods.

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
Wable-iOS/App/SceneDelegate.swift (2)

26-27: loginCoordinator 수명 관리

강한 참조로 잡아두는 건 좋아요. 다만 홈 전환 이후에는 로그인 스택과 코디네이터를 해제해 메모리/상태를 정리하는 편이 안전합니다. 예: 홈으로 전환 직후 loginCoordinator = nil.


65-70: 로그인 루트 구성은 적절하나, 홈 전환과의 일관성 필요

여기서는 window.root를 네비게이션 컨트롤러로 교체하지만, LoginCoordinator.showHome은 모달 present로 탭바를 올립니다. 스택이 중첩되어 뒤에 로그인 스택이 남습니다. 전환 방식을 일관화(루트 교체 or 네비 스택 교체)하는 것을 권장합니다.

추천:

  • 옵션 A(간단): showHome에서 navigationController.setViewControllers([TabBarController(shouldShowLoadingScreen: true)], animated: true)
  • 옵션 B(엄격): 루트 교체를 SceneDelegate로 위임(델리게이트/클로저)해 window.rootViewController = TabBarController(...)로 일원화
Wable-iOS/Presentation/Login/LoginViewController.swift (2)

44-62: 불필요한 lazy 제거

self 캡처가 없고 재할당도 없으므로 lazy var 대신 let 사용이 더 간결합니다.

다음처럼 변경을 권장합니다:

- private lazy var kakaoButton: UIButton = UIButton().then {
+ private let kakaoButton: UIButton = UIButton().then {
   ...
- private lazy var appleButton: UIButton = UIButton().then {
+ private let appleButton: UIButton = UIButton().then {
   ...

158-159: Void 호출에 삼항 연산자 사용 지양

SwiftLint 경고(void_function_in_ternary). if/else로 명확히 표현하세요.

다음으로 교체를 권장합니다:

- condition ? owner.navigateToOnboarding?() : owner.navigateToHome?()
+ if condition {
+     owner.navigateToOnboarding?()
+ } else {
+     owner.navigateToHome?()
+ }
Wable-iOS/Presentation/Login/LoginCoordinator.swift (2)

28-43: 온보딩 진입 시 문자열 하드코딩 제거 제안

제목 "앗 잠깐!"을 StringLiterals로 이동해 일관된 리소스 관리와 i18n 대비를 추천합니다.


46-49: 홈 전환: present 대신 스택 교체로 일관성/메모리 개선

모달 present는 로그인 스택을 뒤에 남깁니다. 네비게이션 스택 교체가 더 깔끔합니다. 또한 SceneDelegate의 메인 진입과 동일하게 로딩 스크린 옵션을 맞추세요.

권장 변경:

-        let tabBarController = TabBarController()
-        tabBarController.modalPresentationStyle = .fullScreen
-        navigationController.present(tabBarController, animated: true)
+        let tabBarController = TabBarController(shouldShowLoadingScreen: true)
+        navigationController.setViewControllers([tabBarController], animated: true)

대안(루트 교체 일원화):

  • 코디네이터 -> SceneDelegate로 콜백을 노출해 window.rootViewController = TabBarController(shouldShowLoadingScreen: true) 수행.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8f29fc and 40124ab.

📒 Files selected for processing (4)
  • Wable-iOS.xcodeproj/project.pbxproj (4 hunks)
  • Wable-iOS/App/SceneDelegate.swift (2 hunks)
  • Wable-iOS/Presentation/Login/LoginCoordinator.swift (1 hunks)
  • Wable-iOS/Presentation/Login/LoginViewController.swift (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
Wable-iOS/App/SceneDelegate.swift (1)
Wable-iOS/Presentation/Login/LoginCoordinator.swift (1)
  • start (11-24)
Wable-iOS/Presentation/Login/LoginCoordinator.swift (1)
Wable-iOS/Presentation/TabBar/TabBarController.swift (1)
  • tabBarController (162-193)
🪛 SwiftLint (0.57.0)
Wable-iOS/Presentation/Login/LoginViewController.swift

[Warning] 158-158: Using ternary to call Void functions should be avoided

(void_function_in_ternary)

🔇 Additional comments (6)
Wable-iOS.xcodeproj/project.pbxproj (4)

182-182: Sources 빌드 파일 추가 확인

LoginCoordinator.swift가 Sources에 정상 추가되었습니다.


569-569: 파일 레퍼런스 추가 확인

LoginCoordinator.swift 레퍼런스가 프로젝트에 정상 등록되었습니다.


1308-1309: 그룹 배치 적절

Presentation/Login 그룹 하위에 배치되어 구조적으로 일관적입니다.


2954-2955: 빌드 페이즈 편입 OK

메인 타깃의 Sources에 1회만 편입되었는지 확인됨. 중복 추가는 없습니다.

Wable-iOS/Presentation/Login/LoginViewController.swift (1)

20-22: 네비게이션 콜백 분리 좋습니다

코디네이터로 내비게이션을 위임하는 형태가 명확하고 테스트/유지보수에 유리합니다.

Wable-iOS/Presentation/Login/LoginCoordinator.swift (1)

11-24: start 구성 및 약한 캡처 적절

뷰모델/뷰컨 생성과 [weak self] 캡처가 적절합니다. 코디네이터 순환 참조 위험도 낮습니다.

Copy link
Collaborator

@JinUng41 JinUng41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~

@youz2me youz2me merged commit 9cf7414 into develop Sep 24, 2025
1 check passed
@youz2me youz2me deleted the refactor/#278-login-coordinator branch September 24, 2025 14:50
youz2me added a commit that referenced this pull request Oct 26, 2025
…ator

[Refactor] 로그인 화면 코디네이터 패턴 적용
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 기존 코드를 리팩토링하거나 수정하는 등 사용 (생산적인 경우) 🦉 유진 🛌🛌🛌🛌🛌🛌🛌🛌🛌🛌

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 로그인 코디네이터 패턴 적용하기

3 participants