From 6abcfed548b36530a8f69460934c2785c7e67836 Mon Sep 17 00:00:00 2001 From: opficdev Date: Wed, 4 Mar 2026 09:47:35 +0900 Subject: [PATCH] =?UTF-8?q?ui:=20PushNotificationView=EC=9D=98=20TodoDetai?= =?UTF-8?q?lView=EB=8A=94=20=EC=88=98=EC=A0=95=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=9D=B4=20=EC=97=86=EB=8F=84=EB=A1=9D=20=EA=B0=9C=EC=84=A0?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/TodoDetailViewModel.swift | 5 ++++- DevLog/UI/Home/TodoDetailView.swift | 18 ++++++++++-------- .../PushNotificationListView.swift | 11 ++++++++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/DevLog/Presentation/ViewModel/TodoDetailViewModel.swift b/DevLog/Presentation/ViewModel/TodoDetailViewModel.swift index 5a9df4d6..e8f403c2 100644 --- a/DevLog/Presentation/ViewModel/TodoDetailViewModel.swift +++ b/DevLog/Presentation/ViewModel/TodoDetailViewModel.swift @@ -35,6 +35,7 @@ final class TodoDetailViewModel: Store { } private(set) var state: State = .init() + let showEditButton: Bool private let fetchUseCase: FetchTodoByIDUseCase private let upsertUseCase: UpsertTodoUseCase private let todoID: String @@ -42,11 +43,13 @@ final class TodoDetailViewModel: Store { init( fetchUseCase: FetchTodoByIDUseCase, upsertUseCase: UpsertTodoUseCase, - todoID: String + todoID: String, + showEditButton: Bool = true ) { self.fetchUseCase = fetchUseCase self.upsertUseCase = upsertUseCase self.todoID = todoID + self.showEditButton = showEditButton } func reduce(with action: Action) -> [SideEffect] { diff --git a/DevLog/UI/Home/TodoDetailView.swift b/DevLog/UI/Home/TodoDetailView.swift index a1696db1..0ca66119 100644 --- a/DevLog/UI/Home/TodoDetailView.swift +++ b/DevLog/UI/Home/TodoDetailView.swift @@ -52,14 +52,16 @@ struct TodoDetailView: View { Image(systemName: "info.circle") } } - if #available(iOS 26.0, *) { - ToolbarSpacer(.fixed, placement: .topBarTrailing) - } - ToolbarItem(placement: .topBarTrailing) { - Button { - viewModel.send(.setShowEditor(true)) - } label: { - Text("수정") + if viewModel.showEditButton { + if #available(iOS 26.0, *) { + ToolbarSpacer(.fixed, placement: .topBarTrailing) + } + ToolbarItem(placement: .topBarTrailing) { + Button { + viewModel.send(.setShowEditor(true)) + } label: { + Text("수정") + } } } } diff --git a/DevLog/UI/PushNotification/PushNotificationListView.swift b/DevLog/UI/PushNotification/PushNotificationListView.swift index e6b43f14..5440b417 100644 --- a/DevLog/UI/PushNotification/PushNotificationListView.swift +++ b/DevLog/UI/PushNotification/PushNotificationListView.swift @@ -79,13 +79,18 @@ struct PushNotificationListView: View { get: { viewModel.state.selectedTodoID }, set: { viewModel.send(.setSelectedTodoID($0)) } )) { item in - VStack(spacing: 0) { - Spacer(minLength: 16) + NavigationStack { TodoDetailView(viewModel: TodoDetailViewModel( fetchUseCase: container.resolve(FetchTodoByIDUseCase.self), upsertUseCase: container.resolve(UpsertTodoUseCase.self), - todoID: item.id + todoID: item.id, + showEditButton: false )) + .toolbar { + ToolbarLeadingButton { + viewModel.send(.setSelectedTodoID(nil)) + } + } } .background(Color(.secondarySystemBackground)) .presentationDragIndicator(.visible)