From 85c58202a6c7cf0dd12307e0718bf489cd14fcc3 Mon Sep 17 00:00:00 2001 From: LeeSeungmin Date: Thu, 1 Feb 2024 18:11:36 +0900 Subject: [PATCH] =?UTF-8?q?[#57]Feat:=20=ED=83=80=EC=9D=B4=EB=A8=B8?= =?UTF-8?q?=EA=B0=80=20=ED=99=9C=EC=84=B1=ED=99=94=20=EC=A4=91=EC=9D=B8?= =?UTF-8?q?=EC=A7=80=20=EC=9C=A0=EB=AC=B4=20=ED=99=95=EC=9D=B8=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20output.isTimerActive=20=EA=B5=AC=EB=8F=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - output.isTimerActive가 true일 때 pause view를 hidden하고 false일 때 보여주기 --- .../Cell/FallingUserCollectionViewCell.swift | 14 ++++++++++++-- .../Cell/FallinguserCollectionViewCellModel.swift | 5 ++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift b/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift index 6a08f73f..9bcb72df 100644 --- a/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift +++ b/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift @@ -36,7 +36,7 @@ final class FallingUserCollectionViewCell: UserCardViewCollectionViewCell { $0.height.equalTo(32) } - self.showUserCardDimView() + self.showDimView() } override func prepareForReuse() { @@ -66,13 +66,23 @@ final class FallingUserCollectionViewCell: UserCardViewCollectionViewCell { output.timeStart .drive(with: self, onNext: { owner, _ in - owner.hiddenUserCardDimView() + owner.hiddenDimView() }) .disposed(by: disposeBag) output.timeZero .drive(scrollToNextObserver) .disposed(by: disposeBag) + + output.isTimerActive + .drive(with: self) { owner, value in + if value { + owner.hiddenPauseView() + } else { + owner.showPauseView() + } + } + .disposed(by: disposeBag) profileCarouselView.infoButton.rx.tap.asDriver() .scan(true) { lastValue, _ in diff --git a/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift b/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift index 1f751a6f..261fc691 100644 --- a/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift +++ b/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift @@ -132,6 +132,7 @@ final class FallinguserCollectionViewCellModel: ViewModelType { let timeState: Driver let timeStart: Driver let timeZero: Driver + let isTimerActive: Driver } func transform(input: Input) -> Output { @@ -164,12 +165,14 @@ final class FallinguserCollectionViewCellModel: ViewModelType { let timeState = timer.map { TimeState(rawValue: $0) } let timeStart = timer.filter { $0 == 8.0 }.map { _ in } let timeZero = timer.filter { $0 == 0 }.map { _ in } + let isTimerActive = timerActiveTrigger.asDriver(onErrorJustReturn: true) return Output( user: user, timeState: timeState, timeStart: timeStart, - timeZero: timeZero + timeZero: timeZero, + isTimerActive: isTimerActive ) } }