From d280f1740fa14ce00cb89e112acc9d2ad1db9545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=8B?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Tue, 24 Feb 2026 18:21:22 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Fix:=20=EB=A3=A8=ED=8B=B4=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=99=84=EB=A3=8C=20=ED=9B=84=20=ED=99=88=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=EC=9C=BC=EB=A1=9C=20=EB=8F=8C=EC=95=84?= =?UTF-8?q?=EA=B0=80=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/RoutineCreationViewController.swift | 35 ++++++++++++------- .../ViewModel/RoutineCreationViewModel.swift | 5 +++ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift b/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift index 9431abf..c67a153 100644 --- a/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift +++ b/Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift @@ -146,19 +146,6 @@ final class RoutineCreationViewController: BaseViewController let executionTimePublisher: AnyPublisher let isRoutineValid: AnyPublisher + let routineCreationResultPublisher: AnyPublisher let networkErrorPublisher: AnyPublisher<(() -> Void)?, Never> } @@ -55,6 +56,7 @@ final class RoutineCreationViewModel: ViewModel { private let periodEndSubject = CurrentValueSubject(nil) private let executionTimeSubject = CurrentValueSubject(.init(startAt: nil)) private let checkRoutinePublisher = CurrentValueSubject(false) + private let routineCreationResultSubject = PassthroughSubject() private let routineUseCase: RoutineUseCaseProtocol private let networkRetryHandler: NetworkRetryHandler private let recommenededRoutineUseCase: RecommendedRoutineUseCaseProtocol @@ -82,6 +84,7 @@ final class RoutineCreationViewModel: ViewModel { .map { $0.startAt } .eraseToAnyPublisher(), isRoutineValid: checkRoutinePublisher.eraseToAnyPublisher(), + routineCreationResultPublisher: routineCreationResultSubject.eraseToAnyPublisher(), networkErrorPublisher: networkRetryHandler.networkErrorActionSubject.eraseToAnyPublisher()) updateIsRoutineValid() @@ -302,8 +305,10 @@ final class RoutineCreationViewModel: ViewModel { try await routineUseCase.saveRoutine(routine: routine) + routineCreationResultSubject.send(true) networkRetryHandler.clearRetryState() } catch { + routineCreationResultSubject.send(false) networkRetryHandler.handleNetworkError(error) { [weak self] in self?.registerRoutine() } From cbd5bce94b393136c409a56434d3a823431e9cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=8B?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Tue, 24 Feb 2026 18:33:23 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=ED=99=88=20=ED=99=94=EB=A9=B4=20pu?= =?UTF-8?q?ll=20to=20refresh=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=ED=95=98=EC=97=AC=20=EB=A3=A8=ED=8B=B4=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Home/View/HomeViewController.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Projects/Presentation/Sources/Home/View/HomeViewController.swift b/Projects/Presentation/Sources/Home/View/HomeViewController.swift index 31c8de3..5e3a6be 100644 --- a/Projects/Presentation/Sources/Home/View/HomeViewController.swift +++ b/Projects/Presentation/Sources/Home/View/HomeViewController.swift @@ -74,6 +74,7 @@ final class HomeViewController: BaseViewController { // routineView private let emptyView = HomeEmptyView() + private let refreshControl = UIRefreshControl() private let routineHeaderView = UIView() private let routineListLabel = UILabel() private let routineListButton = UIButton() @@ -181,6 +182,12 @@ final class HomeViewController: BaseViewController { self.navigationController?.pushViewController(routineCreationView, animated: true) } + routineScrollView.refreshControl = refreshControl + refreshControl.addTarget( + self, + action: #selector(pullToRoutineRefresh), + for: .valueChanged) + routineListLabel.text = "루틴 리스트" routineListLabel.font = BitnagilFont(style: .body2, weight: .semiBold).font routineListLabel.textColor = BitnagilColor.gray60 @@ -433,6 +440,7 @@ final class HomeViewController: BaseViewController { .receive(on: DispatchQueue.main) .sink { [weak self] routines in self?.updateRoutineView(routines: routines) + self?.routineScrollView.refreshControl?.endRefreshing() self?.hideIndicatorView() } .store(in: &cancellables) @@ -635,6 +643,10 @@ final class HomeViewController: BaseViewController { emotionRegistrationViewController.hidesBottomBarWhenPushed = true navigationController?.pushViewController(emotionRegistrationViewController, animated: true) } + + @objc private func pullToRoutineRefresh() { + viewModel.action(input: .refreshDailyRoutine) + } } // MARK: WeekViewDelegate From 0278f0bc0fccf023c85594abd5335aa31e3246d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=8B?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Tue, 24 Feb 2026 19:39:06 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EB=A3=A8=ED=8B=B4=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=ED=91=9C=EC=8B=9C=20=EA=B4=80=EB=A0=A8=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Sources/Home/View/Component/DateView.swift | 4 ++-- .../Presentation/Sources/Home/View/Component/WeekView.swift | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Projects/Presentation/Sources/Home/View/Component/DateView.swift b/Projects/Presentation/Sources/Home/View/Component/DateView.swift index be36374..6e24b81 100644 --- a/Projects/Presentation/Sources/Home/View/Component/DateView.swift +++ b/Projects/Presentation/Sources/Home/View/Component/DateView.swift @@ -124,7 +124,7 @@ final class DateView: UIView { self.isSelected = isSelected } - func updateAllCompleted() { - allCompletedIcon.isHidden.toggle() + func updateAllCompleted(isCompleted: Bool) { + allCompletedIcon.isHidden = !isCompleted } } diff --git a/Projects/Presentation/Sources/Home/View/Component/WeekView.swift b/Projects/Presentation/Sources/Home/View/Component/WeekView.swift index e49d770..60d105f 100644 --- a/Projects/Presentation/Sources/Home/View/Component/WeekView.swift +++ b/Projects/Presentation/Sources/Home/View/Component/WeekView.swift @@ -91,7 +91,7 @@ final class WeekView: UIView { let isAllCompleted = allCompletedDates.contains(date) if isAllCompleted { - dateView.updateAllCompleted() + dateView.updateAllCompleted(isCompleted: true) } dateView.didTapDateButton = { [weak self] date in self?.selectDate(date: date) @@ -109,7 +109,9 @@ final class WeekView: UIView { self.allCompletedDates = allCompletedDates for dateView in dateViews { if allCompletedDates.contains(dateView.key) { - dateView.value.updateAllCompleted() + dateView.value.updateAllCompleted(isCompleted: true) + } else { + dateView.value.updateAllCompleted(isCompleted: false) } } }