Skip to content

Commit

Permalink
[Feat/#104] Feature별 코디네이터 제작
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Nov 26, 2024
1 parent 866653f commit 9fdebbd
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()))
}
}
Original file line number Diff line number Diff line change
@@ -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())
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 9fdebbd

Please sign in to comment.