Skip to content

Commit

Permalink
chore: #146 build 고민... -> 미해결
Browse files Browse the repository at this point in the history
  • Loading branch information
juri123123 committed Jan 24, 2025
1 parent 5a99cb0 commit b047f0c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
//

import Foundation
import SwiftUI

enum NavigationIntent {
// case build
case build(ViewType)
case changeTab(TabType)
case push(ViewType)
case pop(Int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ final class NavigationManager: ObservableObject {

func dispatch(_ intent: NavigationIntent) {
switch intent {
// case .build:
// <#code#>
case .build(let newView):
state.newView = build(newView)
case .changeTab(let tab):
state.selectedTab = tab
case .push(let nextView):
Expand All @@ -37,7 +37,7 @@ final class NavigationManager: ObservableObject {
state.currentLocation = location
}
}

//TODO: 여기 어떻게 할지 생각해보기.........
@ViewBuilder
func build(_ view: ViewType) -> some View {
switch view {
Expand All @@ -63,6 +63,7 @@ extension NavigationManager {
case .register:
state.registerPath.append(view)
}
state.newView = build(view)
}

private func pop(_ depth: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by 최주리 on 1/24/25.
//

import Foundation
import SwiftUI

struct NavigationState {
var selectedTab: TabType = .map
Expand All @@ -14,4 +14,5 @@ struct NavigationState {
var registerPath: [ViewType] = []
var currentLocation: String?
var popup: PopupType?
var newView: any View = Home()
}
2 changes: 1 addition & 1 deletion Spoony-iOS/Spoony-iOS/Source/Feature/SpoonyTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI
//TODO: build 고쳐야함

struct SpoonyTabView: View {
@EnvironmentObject var navigationManager: NavigationManager

Expand Down

0 comments on commit b047f0c

Please sign in to comment.