From 53b4362a763e67e52475dd7b90e2c000c00f16b0 Mon Sep 17 00:00:00 2001 From: HanGyeongjun <030212hgjun@gmail.com> Date: Mon, 13 Nov 2023 11:16:58 +0900 Subject: [PATCH] [Bugfix] #508 - Change to Comment about NavigationStack - need to refactor --- .../Extensions/View/View+Navigation.swift | 34 +++++++++---------- .../ViewModel/WriteShortcutViewModel.swift | 6 ++-- .../Views/TabView/NavigationRouter.swift | 12 +++---- .../Views/TabView/ShortcutTabView.swift | 32 ++++++++--------- .../WriteCurationInfoView.swift | 6 ++-- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift b/HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift index 80281064..27f50f03 100644 --- a/HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift +++ b/HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift @@ -20,12 +20,12 @@ extension View { */ @ViewBuilder func modifierNavigation() -> some View { - if #available(iOS 16.1, *) { +// if #available(iOS 16.1, *) { +// self +// .modifier(NavigationViewModifier()) +// } else { self - .modifier(NavigationViewModifier()) - } else { - self - } +// } } @@ -35,28 +35,28 @@ extension View { */ @ViewBuilder func navigationLinkRouter(data: T) -> some View { - if #available(iOS 16.1, *) { - NavigationLink(value: data) { - self - } - } else { +// if #available(iOS 16.1, *) { +// NavigationLink(value: data) { +// self +// } +// } else { NavigationLink(destination: getDestination(data: data)) { self } - } +// } } @ViewBuilder func navigationLinkRouter(data: T, isPresented: Binding) -> some View { - if #available(iOS 16.1, *) { - NavigationLink(value: data) { - self - } - } else { +// if #available(iOS 16.1, *) { +// NavigationLink(value: data) { +// self +// } +// } else { NavigationLink(destination: getDestination(data: data, isPresented: isPresented)) { self } - } +// } } diff --git a/HappyAnding/HappyAnding/ViewModel/WriteShortcutViewModel.swift b/HappyAnding/HappyAnding/ViewModel/WriteShortcutViewModel.swift index ee11d4f3..8564eb8c 100644 --- a/HappyAnding/HappyAnding/ViewModel/WriteShortcutViewModel.swift +++ b/HappyAnding/HappyAnding/ViewModel/WriteShortcutViewModel.swift @@ -75,9 +75,9 @@ final class WriteShortcutViewModel: ObservableObject { // 서버에 추가 또는 수정 shortcutsZipViewModel.setData(model: shortcut) - if #available(iOS 16.1, *) { - writeShortcutNavigation.navigationPath = .init() - } +// if #available(iOS 16.1, *) { +// writeShortcutNavigation.navigationPath = .init() +// } } func isUnavailableUploadButton() -> Bool { diff --git a/HappyAnding/HappyAnding/Views/TabView/NavigationRouter.swift b/HappyAnding/HappyAnding/Views/TabView/NavigationRouter.swift index 71a79e17..d93a8eb6 100644 --- a/HappyAnding/HappyAnding/Views/TabView/NavigationRouter.swift +++ b/HappyAnding/HappyAnding/Views/TabView/NavigationRouter.swift @@ -15,15 +15,15 @@ struct NavigationRouter: View where Content: View { var body: some View { - if #available(iOS 16.1, *) { - NavigationStack(path: $path, root: content) - .modifier(NavigationViewModifier()) - - } else { +// if #available(iOS 16.1, *) { +// NavigationStack(path: $path, root: content) +// .modifier(NavigationViewModifier()) +// +// } else { NavigationView(content: content) .navigationViewStyle(StackNavigationViewStyle()) } - } +// } } diff --git a/HappyAnding/HappyAnding/Views/TabView/ShortcutTabView.swift b/HappyAnding/HappyAnding/Views/TabView/ShortcutTabView.swift index 0e361099..6977f1ae 100644 --- a/HappyAnding/HappyAnding/Views/TabView/ShortcutTabView.swift +++ b/HappyAnding/HappyAnding/Views/TabView/ShortcutTabView.swift @@ -201,22 +201,22 @@ extension View { func didTappedTabViewItem(_ proxy: ScrollViewProxy, scrollID: Int, navigationPath: inout NavigationPath, viewID: inout UUID) { // MARK: Navigation Stack - if #available(iOS 16.1, *) { - - // Root View로 이동 - if navigationPath.count > 0 { - navigationPath = NavigationPath() - - } else { - // 최상단으로 이동 - withAnimation { - proxy.scrollTo(scrollID, anchor: .bottom) - } - } - - // MARK: Navigation View - } else { +// if #available(iOS 16.1, *) { +// +// // Root View로 이동 +// if navigationPath.count > 0 { +// navigationPath = NavigationPath() +// +// } else { +// // 최상단으로 이동 +// withAnimation { +// proxy.scrollTo(scrollID, anchor: .bottom) +// } +// } +// +// // MARK: Navigation View +// } else { viewID = UUID() } - } +// } } diff --git a/HappyAnding/HappyAnding/Views/WriteCurationViews/WriteCurationInfoView.swift b/HappyAnding/HappyAnding/Views/WriteCurationViews/WriteCurationInfoView.swift index 1576c6a6..b884d0fc 100644 --- a/HappyAnding/HappyAnding/Views/WriteCurationViews/WriteCurationInfoView.swift +++ b/HappyAnding/HappyAnding/Views/WriteCurationViews/WriteCurationInfoView.swift @@ -64,9 +64,9 @@ struct WriteCurationInfoView: View { shortcutsZipViewModel.addCuration(curation: data.curation, isEdit: data.isEdit, deletedShortcutCells: data.deletedShortcutCells) self.isWriting.toggle() - if #available(iOS 16.1, *) { - writeCurationNavigation.navigationPath = .init() - } +// if #available(iOS 16.1, *) { +// writeCurationNavigation.navigationPath = .init() +// } } label: { Text(TextLiteral.upload) .shortcutsZipHeadline()