Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Wable-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
DD9EAE282D99C7DE00803A1A /* DeleteContentUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD9EAE272D99C7D200803A1A /* DeleteContentUseCase.swift */; };
DD9EAE2E2D9A63FD00803A1A /* WritePostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD9EAE2D2D9A63F400803A1A /* WritePostViewController.swift */; };
DD9EAE302D9A64A800803A1A /* HomeDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD9EAE2F2D9A649D00803A1A /* HomeDetailViewController.swift */; };
DDA138D82E84235600F7B63C /* LoginCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA138D72E84235600F7B63C /* LoginCoordinator.swift */; };
DDA2098D2D9BFB9F008042DA /* WritePostViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA2098C2D9BFB98008042DA /* WritePostViewModel.swift */; };
DDCA70902D87CE2700A988B8 /* LCKYearViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCA708F2D87CE0500A988B8 /* LCKYearViewController.swift */; };
DDCA70932D88316200A988B8 /* LCKYearView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCA70922D88315C00A988B8 /* LCKYearView.swift */; };
Expand Down Expand Up @@ -565,6 +566,7 @@
DD9EAE272D99C7D200803A1A /* DeleteContentUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteContentUseCase.swift; sourceTree = "<group>"; };
DD9EAE2D2D9A63F400803A1A /* WritePostViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WritePostViewController.swift; sourceTree = "<group>"; };
DD9EAE2F2D9A649D00803A1A /* HomeDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeDetailViewController.swift; sourceTree = "<group>"; };
DDA138D72E84235600F7B63C /* LoginCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginCoordinator.swift; sourceTree = "<group>"; };
DDA2098C2D9BFB98008042DA /* WritePostViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WritePostViewModel.swift; sourceTree = "<group>"; };
DDCA708F2D87CE0500A988B8 /* LCKYearViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCKYearViewController.swift; sourceTree = "<group>"; };
DDCA70922D88315C00A988B8 /* LCKYearView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCKYearView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1303,6 +1305,7 @@
children = (
DD4AFD442D8FF19B00D56B94 /* LoginViewModel.swift */,
DD765D992D8746DD0029A317 /* LoginViewController.swift */,
DDA138D72E84235600F7B63C /* LoginCoordinator.swift */,
);
path = Login;
sourceTree = "<group>";
Expand Down Expand Up @@ -2948,6 +2951,7 @@
DD9EAE2E2D9A63FD00803A1A /* WritePostViewController.swift in Sources */,
DD51A44C2DD458A8004295B6 /* ProfileEditViewController.swift in Sources */,
DD2967FF2D6DAC8900143851 /* SceneDelegate.swift in Sources */,
DDA138D82E84235600F7B63C /* LoginCoordinator.swift in Sources */,
DD2968172D6DAD0200143851 /* ContentRepository.swift in Sources */,
DDED595E2D78C3E000A0BEF1 /* KakaoAuthProvider.swift in Sources */,
DD2968182D6DAD0200143851 /* CommunityRepository.swift in Sources */,
Expand Down
8 changes: 7 additions & 1 deletion Wable-iOS/App/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
private let userSessionRepository = UserSessionRepositoryImpl(userDefaults: UserDefaultsStorage())
private let checkAppUpdateRequirementUseCase = CheckAppUpdateRequirementUseCaseImpl()

private var loginCoordinator: LoginCoordinator?

// MARK: - UIComponent

var window: UIWindow?
Expand Down Expand Up @@ -60,7 +62,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

private extension SceneDelegate {
func configureLoginScreen() {
self.window?.rootViewController = LoginViewController(viewModel: LoginViewModel())
let navigationController = UINavigationController()
navigationController.navigationBar.isHidden = true
loginCoordinator = LoginCoordinator(navigationController: navigationController)
loginCoordinator?.start()
self.window?.rootViewController = navigationController
}

func configureMainScreen() {
Expand Down
50 changes: 50 additions & 0 deletions Wable-iOS/Presentation/Login/LoginCoordinator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import UIKit

final class LoginCoordinator: Coordinator {
var childCoordinators: [Coordinator] = []
var navigationController: UINavigationController

init(navigationController: UINavigationController) {
self.navigationController = navigationController
}

func start() {
let viewModel = LoginViewModel()
let viewController = LoginViewController(viewModel: viewModel)

viewController.navigateToOnboarding = { [weak self] in
self?.showOnboarding()
}

viewController.navigateToHome = { [weak self] in
self?.showHome()
}

navigationController.setViewControllers([viewController], animated: false)
}
}

private extension LoginCoordinator {
func showOnboarding() {
let noticeViewController = WableSheetViewController(
title: "앗 잠깐!",
message: StringLiterals.Onboarding.enterSheetTitle
)

noticeViewController.addAction(.init(title: "확인", style: .primary, handler: { [weak self] in
let onboardingNavigationController = UINavigationController(rootViewController: LCKYearViewController(type: .flow))
onboardingNavigationController.navigationBar.isHidden = true
onboardingNavigationController.modalPresentationStyle = .fullScreen

self?.navigationController.present(onboardingNavigationController, animated: true)
}))

navigationController.present(noticeViewController, animated: true)
}

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.
navigationController.present(tabBarController, animated: true)
}
}
34 changes: 4 additions & 30 deletions Wable-iOS/Presentation/Login/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ final class LoginViewController: UIViewController {
private let viewModel: LoginViewModel
private let cancelBag = CancelBag()

var navigateToOnboarding: (() -> Void)?
var navigateToHome: (() -> Void)?

// MARK: UIComponent

private let backgroundImageView: UIImageView = UIImageView(image: .imgLoginBackground).then {
Expand Down Expand Up @@ -152,7 +155,7 @@ private extension LoginViewController {
let condition = sessionInfo.isNewUser || sessionInfo.user.nickname == ""

if condition { AmplitudeManager.shared.trackEvent(tag: .clickAgreePopupSignup) }
condition ? owner.navigateToOnboarding() : owner.navigateToHome()
condition ? owner.navigateToOnboarding?() : owner.navigateToHome?()
}
.store(in: cancelBag)

Expand All @@ -171,32 +174,3 @@ private extension LoginViewController {
.store(in: cancelBag)
}
}

// MARK: - Helper Method

private extension LoginViewController {
func navigateToOnboarding() {
let noticeViewController = WableSheetViewController(
title: "앗 잠깐!",
message: StringLiterals.Onboarding.enterSheetTitle
)

noticeViewController.addAction(.init(title: "확인", style: .primary, handler: {
let navigationController = UINavigationController(rootViewController: LCKYearViewController(type: .flow)).then {
$0.navigationBar.isHidden = true
$0.modalPresentationStyle = .fullScreen
}

self.present(navigationController, animated: true)
}))

present(noticeViewController, animated: true)
}

func navigateToHome() {
let tabBarController = TabBarController()

present(tabBarController, animated: true)
}
}