From 9fdebbdfa0e98b372ce69bfe2296bed442ded5f1 Mon Sep 17 00:00:00 2001 From: Zoe Date: Sat, 16 Nov 2024 03:46:39 +0900 Subject: [PATCH] =?UTF-8?q?[Feat/#104]=20Feature=EB=B3=84=20=EC=BD=94?= =?UTF-8?q?=EB=94=94=EB=84=A4=EC=9D=B4=ED=84=B0=20=EC=A0=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Coordinator/AuthCoordinator.swift | 29 +++++++++++++++ .../Coordinator/OnboardingCoordinator.swift | 29 +++++++++++++++ .../Coordinator/TabBarCoordinator.swift | 35 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 HMH_Tuist_iOS/Projects/App/Sources/Coordinator/AuthCoordinator.swift create mode 100644 HMH_Tuist_iOS/Projects/App/Sources/Coordinator/OnboardingCoordinator.swift create mode 100644 HMH_Tuist_iOS/Projects/App/Sources/Coordinator/TabBarCoordinator.swift diff --git a/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/AuthCoordinator.swift b/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/AuthCoordinator.swift new file mode 100644 index 00000000..4bff3112 --- /dev/null +++ b/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/AuthCoordinator.swift @@ -0,0 +1,29 @@ +// +// LoginCoordinator.swift +// Coordinator +// +// Created by 이지희 on 11/15/24. +// Copyright © 2024 HMH-iOS. All rights reserved. +// + +import SwiftUI + +import LoginFeature + +final class AuthCoordinator: ObservableObject, CoordinatorType { + var parentCoordinator: (any CoordinatorType)? + + var navigationPath: NavigationPath + + init( + parentCoordinator: any CoordinatorType, + navigationPath: NavigationPath + ) { + self.parentCoordinator = parentCoordinator + self.navigationPath = navigationPath + } + + func start() -> AnyView { + return AnyView(LoginView(viewModel: LoginViewModel())) + } +} diff --git a/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/OnboardingCoordinator.swift b/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/OnboardingCoordinator.swift new file mode 100644 index 00000000..9270f8c3 --- /dev/null +++ b/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/OnboardingCoordinator.swift @@ -0,0 +1,29 @@ +// +// OnboardingCoordinator.swift +// Coordinator +// +// Created by 이지희 on 11/15/24. +// Copyright © 2024 HMH-iOS. All rights reserved. +// + +import SwiftUI + +import OnboardingFeature + +final class OnboardingCoordinator: ObservableObject, CoordinatorType { + var parentCoordinator: (any CoordinatorType)? + + var navigationPath: NavigationPath + + init( + parentCoordinator: (any CoordinatorType)? = nil, + navigationPath: NavigationPath + ) { + self.parentCoordinator = parentCoordinator + self.navigationPath = navigationPath + } + + func start() -> AnyView { + return AnyView(OnboardingContentView()) + } +} diff --git a/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/TabBarCoordinator.swift b/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/TabBarCoordinator.swift new file mode 100644 index 00000000..bb88f97f --- /dev/null +++ b/HMH_Tuist_iOS/Projects/App/Sources/Coordinator/TabBarCoordinator.swift @@ -0,0 +1,35 @@ +// +// TabBarCoordinator.swift +// Coordinator +// +// Created by 이지희 on 11/15/24. +// Copyright © 2024 HMH-iOS. All rights reserved. +// + +import SwiftUI + +class TabBarCoordinator: ObservableObject, CoordinatorType { + var navigationPath: NavigationPath + + var parentCoordinator: (any CoordinatorType)? + + @Published var selectedTab: Tab = .home + + init( + parentCoordinator: CoordinatorType, + navigationPath: NavigationPath + ) { + self.parentCoordinator = parentCoordinator + self.navigationPath = navigationPath + } + + func start() -> AnyView { + AnyView(TabBarView()) + } + + enum Tab { + case home + case challenge + case myPage + } +}