From d00da82cfb4939cb3ae0c677f441d3ae2bdf0884 Mon Sep 17 00:00:00 2001 From: youn9k Date: Wed, 4 Sep 2024 23:25:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20::=20[#1289]=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=EB=90=9C=20=EC=97=B4=EB=A7=A4=ED=95=A8=20=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyInfo/MyInfoViewController.swift | 10 +++++++--- .../Sources/Views/FruitDrawButtonView.swift | 13 ++++++++++++- .../MyInfoFeature/Sources/Views/MyInfoView.swift | 2 ++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift b/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift index 0e3e7cbaf..9075a6b68 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift @@ -242,10 +242,14 @@ final class MyInfoViewController: BaseReactorViewController, Edit .bind(to: reactor.action) .disposed(by: disposeBag) + myInfoView.rx.fruitStorageButtonDidTap + .do(onNext: { LogManager.analytics(MyInfoAnalyticsLog.clickFruitStorageButton) }) + .map { MyInfoReactor.Action.fruitNavigationDidTap } + .bind(to: reactor.action) + .disposed(by: disposeBag) + myInfoView.rx.drawButtonDidTap - .do(onNext: { - LogManager.analytics(MyInfoAnalyticsLog.clickFruitDrawEntryButton(location: .myPage)) - }) + .do(onNext: { LogManager.analytics(MyInfoAnalyticsLog.clickFruitDrawEntryButton(location: .myPage)) }) .map { MyInfoReactor.Action.drawButtonDidTap } .bind(to: reactor.action) .disposed(by: disposeBag) diff --git a/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift b/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift index 5ccba7882..fb01396a0 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift @@ -10,6 +10,7 @@ private protocol FruitDrawStateProtocol { } private protocol FruitDrawActionProtocol { + var fruitStorageButtonDidTap: Observable { get } var drawButtonDidTap: Observable { get } } @@ -39,7 +40,9 @@ final class FruitDrawButtonView: UIView { lineHeight: UIFont.WMFontSystem.t5().lineHeight, kernValue: -0.5 ) - + + let fruitStorageButton = UIButton() + let drawButton = UIButton().then { $0.titleLabel?.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) $0.setTitle("뽑기", for: .normal) @@ -66,6 +69,7 @@ extension FruitDrawButtonView { backgroundView, titleLabel, countLabel, + fruitStorageButton, drawButton ) } @@ -85,6 +89,12 @@ extension FruitDrawButtonView { $0.left.equalTo(titleLabel.snp.right).offset(8) } + fruitStorageButton.snp.makeConstraints { + $0.verticalEdges.equalTo(backgroundView.snp.verticalEdges) + $0.leading.equalTo(backgroundView.snp.leading) + $0.trailing.equalTo(drawButton.snp.leading) + } + drawButton.snp.makeConstraints { $0.verticalEdges.equalTo(backgroundView.snp.verticalEdges) $0.trailing.equalTo(backgroundView.snp.trailing) @@ -100,5 +110,6 @@ extension FruitDrawButtonView: FruitDrawStateProtocol { } extension Reactive: FruitDrawActionProtocol where Base: FruitDrawButtonView { + var fruitStorageButtonDidTap: Observable { base.fruitStorageButton.rx.tap.asObservable() } var drawButtonDidTap: Observable { base.drawButton.rx.tap.asObservable() } } diff --git a/Projects/Features/MyInfoFeature/Sources/Views/MyInfoView.swift b/Projects/Features/MyInfoFeature/Sources/Views/MyInfoView.swift index beba24a79..894c8874d 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/MyInfoView.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/MyInfoView.swift @@ -17,6 +17,7 @@ private protocol MyInfoActionProtocol { var scrollViewDidTap: Observable { get } var loginButtonDidTap: Observable { get } var profileImageDidTap: Observable { get } + var fruitStorageButtonDidTap: Observable { get } var drawButtonDidTap: Observable { get } var fruitNavigationButtonDidTap: Observable { get } var qnaNavigationButtonDidTap: Observable { get } @@ -204,6 +205,7 @@ extension Reactive: MyInfoActionProtocol where Base: MyInfoView { var loginButtonDidTap: Observable { base.loginWarningView.rx.loginButtonDidTap } var profileImageDidTap: Observable { base.profileView.rx.profileImageDidTap } + var fruitStorageButtonDidTap: Observable { base.fruitDrawButtonView.rx.fruitStorageButtonDidTap } var drawButtonDidTap: Observable { base.fruitDrawButtonView.rx.drawButtonDidTap } var fruitNavigationButtonDidTap: Observable { base.fruitNavigationButton.rx.tap.asObservable() } var qnaNavigationButtonDidTap: Observable { base.qnaNavigationButton.rx.tap.asObservable() } From 51a79010eef9005a0b6fac6094b623ad78d55c3b Mon Sep 17 00:00:00 2001 From: youn9k Date: Wed, 4 Sep 2024 23:25:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewControllers/MyInfo/MyInfoViewController.swift | 2 +- .../MyInfoFeature/Sources/Views/FruitDrawButtonView.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift b/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift index 9075a6b68..60cb00400 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewControllers/MyInfo/MyInfoViewController.swift @@ -247,7 +247,7 @@ final class MyInfoViewController: BaseReactorViewController, Edit .map { MyInfoReactor.Action.fruitNavigationDidTap } .bind(to: reactor.action) .disposed(by: disposeBag) - + myInfoView.rx.drawButtonDidTap .do(onNext: { LogManager.analytics(MyInfoAnalyticsLog.clickFruitDrawEntryButton(location: .myPage)) }) .map { MyInfoReactor.Action.drawButtonDidTap } diff --git a/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift b/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift index fb01396a0..83002867f 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/FruitDrawButtonView.swift @@ -40,9 +40,9 @@ final class FruitDrawButtonView: UIView { lineHeight: UIFont.WMFontSystem.t5().lineHeight, kernValue: -0.5 ) - + let fruitStorageButton = UIButton() - + let drawButton = UIButton().then { $0.titleLabel?.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) $0.setTitle("뽑기", for: .normal) @@ -94,7 +94,7 @@ extension FruitDrawButtonView { $0.leading.equalTo(backgroundView.snp.leading) $0.trailing.equalTo(drawButton.snp.leading) } - + drawButton.snp.makeConstraints { $0.verticalEdges.equalTo(backgroundView.snp.verticalEdges) $0.trailing.equalTo(backgroundView.snp.trailing)