diff --git a/Projects/Presentation/Sources/EmotionRegister/View/EmotionRegisterCompletionViewController.swift b/Projects/Presentation/Sources/EmotionRegister/View/EmotionRegisterCompletionViewController.swift index bfd8d223..c8444920 100644 --- a/Projects/Presentation/Sources/EmotionRegister/View/EmotionRegisterCompletionViewController.swift +++ b/Projects/Presentation/Sources/EmotionRegister/View/EmotionRegisterCompletionViewController.swift @@ -5,6 +5,7 @@ // Created by 이동현 on 8/23/25. // +import Shared import SnapKit import UIKit @@ -30,6 +31,7 @@ final class EmotionRegisterCompletionViewController: UIViewController { static let marbleImageTopSpacing: CGFloat = 96.92 } + private let emotion: Emotion private let backgroundImageView = UIImageView() private let groundImageView = UIImageView() private let speechImageView = UIImageView() @@ -40,6 +42,7 @@ final class EmotionRegisterCompletionViewController: UIViewController { private let pomoRightHandImageView = UIImageView() init(emotion: Emotion) { + self.emotion = emotion super.init(nibName: nil, bundle: nil) marbleImageView.image = emotion.image @@ -57,11 +60,14 @@ final class EmotionRegisterCompletionViewController: UIViewController { super.viewDidLoad() configureAttribute() configureLayout() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) - // TODO: - 임시 네비 바 설정 - configureCustomNavigationBar(navigationBarStyle: .withBackButton(title: "임시뒤로가기")) - let filteredNavigations = navigationController?.viewControllers.filter { !($0 is EmotionRegistrationViewController) } ?? [] - navigationController?.setViewControllers(filteredNavigations, animated: false) + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in + self?.goToRecommendedRoutineView() + } } func configureAttribute() { @@ -136,4 +142,14 @@ final class EmotionRegisterCompletionViewController: UIViewController { make.horizontalEdges.equalTo(speechImageView).inset(Layout.speechImageHorizontalSpacing) } } + + private func goToRecommendedRoutineView() { + guard let resultRecommendedRoutineViewModel = DIContainer.shared.resolve(type: ResultRecommendedRoutineViewModel.self) + else{ fatalError("resultRecommendedRoutineViewModel 의존성이 등록되지 않았습니다.") } + + resultRecommendedRoutineViewModel.configure(viewModelType: .emotion(emotion: emotion)) + let resultRecommendedRoutineView = ResultRecommendedRoutineViewController(entryPoint: .emotion, viewModel: resultRecommendedRoutineViewModel) + resultRecommendedRoutineView.hidesBottomBarWhenPushed = true + self.navigationController?.pushViewController(resultRecommendedRoutineView, animated: true) + } } diff --git a/Projects/Presentation/Sources/MyPage/View/MypageView.swift b/Projects/Presentation/Sources/MyPage/View/MypageView.swift index fe900e14..bb62b692 100644 --- a/Projects/Presentation/Sources/MyPage/View/MypageView.swift +++ b/Projects/Presentation/Sources/MyPage/View/MypageView.swift @@ -41,6 +41,9 @@ final class MypageView: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + + navigationController?.setNavigationBarHidden(false, animated: animated) + let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundColor = .white diff --git a/Projects/Presentation/Sources/RecommendedRoutine/View/RecommendedRoutineViewController.swift b/Projects/Presentation/Sources/RecommendedRoutine/View/RecommendedRoutineViewController.swift index 0b2b03c9..b5bb5cd5 100644 --- a/Projects/Presentation/Sources/RecommendedRoutine/View/RecommendedRoutineViewController.swift +++ b/Projects/Presentation/Sources/RecommendedRoutine/View/RecommendedRoutineViewController.swift @@ -79,6 +79,7 @@ final class RecommendedRoutineViewController: BaseViewController= 3 { - navigationController.popToViewController(viewControllers[viewControllers.count - 3], animated: false) + skipButton.addAction( + UIAction { [weak self] _ in + guard let self else { return } + switch entryPoint { + case .emotion: + if + let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let window = windowScene.windows.first(where: { $0.isKeyWindow }), + let tabBarView = window.rootViewController as? TabBarView { + self.navigationController?.popToRootViewController(animated: false) + tabBarView.selectedIndex = 0 } + + case .onboarding: + goToNextView() + + case .mypage: + break } - case .onboarding, .mypage: - goToNextView() - } - }, for: .touchUpInside) + }, + for: .touchUpInside) } private func goToNextView() { @@ -337,6 +343,9 @@ final class ResultRecommendedRoutineViewController: BaseViewController() init( @@ -75,6 +76,7 @@ final class RoutineCreationViewController: BaseViewController