diff --git a/Projects/Presentation/Sources/Common/Extension/Notification+.swift b/Projects/Presentation/Sources/Common/Extension/Notification+.swift index 3df19b5..a4def73 100644 --- a/Projects/Presentation/Sources/Common/Extension/Notification+.swift +++ b/Projects/Presentation/Sources/Common/Extension/Notification+.swift @@ -10,4 +10,5 @@ import Foundation extension Notification.Name { static let showRecommendedRoutineToast = Notification.Name("showRecommendedRoutineToast") static let showDeletedRoutineToast = Notification.Name("showDeletedRoutineToast") + static let showUpdatedRoutineToast = Notification.Name("showUpdatedRoutineToast") } diff --git a/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift b/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift index b85304f..843bf6a 100644 --- a/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift +++ b/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift @@ -155,6 +155,7 @@ final class RoutineCreationViewController: BaseViewController private let routineStackView = UIStackView() private var routineCardViews: [String: RoutineCardView] = [:] private let deleteToastMessage: String = "삭제가 완료되었습니다." + private let updateToastMessage: String = "루틴 수정이 완료되었습니다." private var toastMessageView = ToastView(message: "") private var dimmedView: UIView? private var cancellables: Set @@ -149,6 +150,16 @@ final class RoutineListViewController: BaseViewController self.toastMessageView.showToastMessageView(message: deleteToastMessage) } .store(in: &cancellables) + + NotificationCenter.default.publisher(for: .showUpdatedRoutineToast) + .receive(on: DispatchQueue.main) + .sink { [weak self] _ in + guard let self else { return } + self.viewModel.action(input: .fetchRoutineList) + self.viewModel.action(input: .fetchDailyRoutine) + self.toastMessageView.showToastMessageView(message: updateToastMessage) + } + .store(in: &cancellables) } private func updateRoutineStackView(routines: [Routine]) {