From f64a440c8e2e148286ea76c37993eeaf9d30cb87 Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 00:38:43 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=F0=9F=90=9B=20=EC=A2=8B=EC=95=84=EC=9A=94?= =?UTF-8?q?=20=EB=B3=B4=EB=82=B4=EA=B8=B0=20API=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=EC=97=90=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Like/Post/PostLikeRequest.swift | 8 ++++++-- .../Targets/Router/GuestListRouter.swift | 1 + .../RoutingProtocol/LikeRequestDataSource.swift | 1 + .../Scene/Sources/LikeRequestInteractor.swift | 15 +++++++++++---- .../Targets/Scene/Sources/LikeRequestWorker.swift | 9 +++++---- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Projects/DataSource/Sources/Like/Post/PostLikeRequest.swift b/Projects/DataSource/Sources/Like/Post/PostLikeRequest.swift index 777531a..8b8cdc2 100644 --- a/Projects/DataSource/Sources/Like/Post/PostLikeRequest.swift +++ b/Projects/DataSource/Sources/Like/Post/PostLikeRequest.swift @@ -32,14 +32,18 @@ public struct PostLikeRequestBody: RequestBody { public var receiverProfileId: Int public var senderProfileId: Int - + + public var weddingId: Int + public init( message: String, receiverProfileId: Int, - senderProfileId: Int + senderProfileId: Int, + weddingId: Int ) { self.message = message self.receiverProfileId = receiverProfileId self.senderProfileId = senderProfileId + self.weddingId = weddingId } } diff --git a/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift b/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift index a90aa7f..60c8353 100644 --- a/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift +++ b/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift @@ -30,6 +30,7 @@ public class GuestListRouter: GuestListRoutingLogic, GuestListDataPassing { return } let destinationVC = LikeRequestViewController() + destinationVC.router?.dataStore?.weddingId = dataStore.meetingId destinationVC.router?.dataStore?.targetGuest = guest viewController?.navigationController?.pushViewController(destinationVC, animated: true) } diff --git a/Projects/Features/LikeRequest/Targets/RoutingProtocol/LikeRequestDataSource.swift b/Projects/Features/LikeRequest/Targets/RoutingProtocol/LikeRequestDataSource.swift index 9f18339..855bc32 100644 --- a/Projects/Features/LikeRequest/Targets/RoutingProtocol/LikeRequestDataSource.swift +++ b/Projects/Features/LikeRequest/Targets/RoutingProtocol/LikeRequestDataSource.swift @@ -10,4 +10,5 @@ import Models public protocol LikeRequestDataStore { var targetGuest: Guest? { get set } + var weddingId: Int? { get set } } diff --git a/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestInteractor.swift b/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestInteractor.swift index 40ab3ff..2bb033d 100644 --- a/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestInteractor.swift +++ b/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestInteractor.swift @@ -24,7 +24,8 @@ class LikeRequestInteractor: LikeRequestBusinessLogic, LikeRequestDataStore { var worker: LikeRequestWorkerProtocol? var targetGuest: Guest? - + var weddingId: Int? + init(worker: LikeRequestWorkerProtocol = LikeRequestWorker()) { self.worker = worker } @@ -43,12 +44,18 @@ class LikeRequestInteractor: LikeRequestBusinessLogic, LikeRequestDataStore { return } // TODO: 좋아요 요청 통신 - + let receiverProfileId = targetGuest?.user.id ?? 0 - + guard let weddingId = weddingId else { + presenter?.presentLikeRequestError(response: .init(message: "좋아요 보내기 실패")) + return + } + Task { do { - let _ = try await worker.requestLike(message: request.message, receiverProfileId: receiverProfileId) + + print(weddingId) + let _ = try await worker.requestLike(message: request.message, receiverProfileId: receiverProfileId, weddingId: weddingId) presenter?.presentLikeRequestSuccess() } catch { diff --git a/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestWorker.swift b/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestWorker.swift index da2c498..a2c0008 100644 --- a/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestWorker.swift +++ b/Projects/Features/LikeRequest/Targets/Scene/Sources/LikeRequestWorker.swift @@ -15,11 +15,11 @@ import DataSource protocol LikeRequestWorkerProtocol { func getMyName() -> String - func requestLike(message: String, receiverProfileId: Int) async throws + func requestLike(message: String, receiverProfileId: Int, weddingId: Int) async throws } class LikeRequestWorker: LikeRequestWorkerProtocol { - + let userLocalDataSource: UserLocalDataSoureceProtocol let likeDataSource: LikeDataSourceProtocol @@ -38,13 +38,14 @@ class LikeRequestWorker: LikeRequestWorkerProtocol { return user.name } - func requestLike(message: String, receiverProfileId: Int) async throws { + func requestLike(message: String, receiverProfileId: Int, weddingId: Int) async throws { let senderProfileId = userLocalDataSource.read(key: .localUser)?.id ?? 0 let request = PostLikeRequest( body: .init( message: message, receiverProfileId: receiverProfileId, - senderProfileId: senderProfileId + senderProfileId: senderProfileId, + weddingId: weddingId ) ) do { From 58eea6e0e869478133a476d6b1c60394f5c9db97 Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 00:39:10 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=90=9B=20=EC=97=A1=ED=8B=B0=EB=B7=B0?= =?UTF-8?q?=20=EB=B2=84=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 --- .../Targets/Scene/Sources/MyGuestListViewController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Projects/Features/MyGuestList/Targets/Scene/Sources/MyGuestListViewController.swift b/Projects/Features/MyGuestList/Targets/Scene/Sources/MyGuestListViewController.swift index 0f8a1e2..220edb2 100644 --- a/Projects/Features/MyGuestList/Targets/Scene/Sources/MyGuestListViewController.swift +++ b/Projects/Features/MyGuestList/Targets/Scene/Sources/MyGuestListViewController.swift @@ -136,7 +136,12 @@ public final class MyGuestListViewController: UIViewController, MyGuestListDispl public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - self.interactor?.fetchMyLikeGuests() + switch displayType { + case .myLike: + self.interactor?.fetchMyLikeGuests() + case .matching: + self.interactor?.fetchMatchingGuests() + } } private func setUI() { From 154c7931ae50934829d3dfeca7bf0fdad44a30c1 Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 00:39:25 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=F0=9F=90=9B=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=20API=20=EB=B2=84=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 --- Projects/Features/Login/Targets/Scene/Sources/LoginWorker.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Features/Login/Targets/Scene/Sources/LoginWorker.swift b/Projects/Features/Login/Targets/Scene/Sources/LoginWorker.swift index 099e500..cdd4dbf 100644 --- a/Projects/Features/Login/Targets/Scene/Sources/LoginWorker.swift +++ b/Projects/Features/Login/Targets/Scene/Sources/LoginWorker.swift @@ -56,7 +56,7 @@ class LoginWorker: LoginWorkerProtocol { Task { do { guard let token = token else { return } - let result = try await self.login(oauthType: "", token: token) + let result = try await self.login(oauthType: "KAKAO", token: token) self.fetchUser?(result) } catch { self.fetchUser?(.failure(.loginDataSourceError)) From 5ce1805a9e099ee3f3558ca3d32af4864c1db000 Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 00:48:04 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=E2=9C=A8=20=EC=9D=B8=EC=A6=9D=EC=BD=94?= =?UTF-8?q?=EB=93=9C=EC=97=90=EC=84=9C=20=EB=92=A4=EB=A1=9C=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/AuthCodeViewController.swift | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/Projects/Features/AuthCode/Targets/Scene/Sources/AuthCodeViewController.swift b/Projects/Features/AuthCode/Targets/Scene/Sources/AuthCodeViewController.swift index 4c71727..e1ac7dc 100644 --- a/Projects/Features/AuthCode/Targets/Scene/Sources/AuthCodeViewController.swift +++ b/Projects/Features/AuthCode/Targets/Scene/Sources/AuthCodeViewController.swift @@ -87,7 +87,15 @@ public final class AuthCodeViewController: UIViewController, AuthCodeDisplayLogi v.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) return v }() - + + lazy var leftButton: MTButton = { + let button = MTButton.create(.mainSmallDark) + button.title = "PRE" + button.isEnabled = true + button.addTarget(self, action: #selector(pressPrevButton(_:)), for: .touchUpInside) + return button + }() + lazy var rightButton: MTButton = { let button = MTButton.create(.mainDark) button.title = "NEXT" @@ -111,6 +119,7 @@ public final class AuthCodeViewController: UIViewController, AuthCodeDisplayLogi self.view.addSubview(self.titleLabel) self.view.addSubview(self.subtitleLabel) self.view.addSubview(self.authCodeTextField) + self.view.addSubview(self.leftButton) self.view.addSubview(self.rightButton) self.headerImageView.snp.makeConstraints { make in @@ -133,7 +142,12 @@ public final class AuthCodeViewController: UIViewController, AuthCodeDisplayLogi make.leading.trailing.equalToSuperview().inset(32) make.height.equalTo(79) } - + + self.leftButton.snp.makeConstraints { make in + make.leading.equalToSuperview().offset(32) + make.bottom.equalToSuperview().inset(40) + make.height.equalTo(56) + } self.rightButton.snp.makeConstraints { make in make.trailing.equalToSuperview().offset(-32) make.bottom.equalToSuperview().inset(40) @@ -165,9 +179,23 @@ public final class AuthCodeViewController: UIViewController, AuthCodeDisplayLogi } func displayWeddingCodeError(viewModel: AuthCode.RequestWeddingCode.ViewModel.Error) { - // TODO: 에러 처리 + DispatchQueue.main.async { + let alertViewController = UIAlertController( + title: "인증코드 오류", + message: "\(viewModel.message)", + preferredStyle: .alert) + alertViewController.addAction(UIAlertAction(title: "다시 입력하기", style: .default, handler: nil)) + + self.present(alertViewController, animated: true) + } } - + + @objc func pressPrevButton(_ sender: UIButton) { + DispatchQueue.main.async { [weak self] in + self?.router?.removeFromParent() + } + } + @objc func didTapRightButton() { guard let weddingCode = authCodeTextField.text else { return @@ -191,6 +219,9 @@ public final class AuthCodeViewController: UIViewController, AuthCodeDisplayLogi self.headerImageView.snp.updateConstraints { make in make.top.equalTo(self.view.safeAreaLayoutGuide).inset(46 - keyboardHeight) } + self.leftButton.snp.updateConstraints { make in + make.bottom.equalToSuperview().inset(40 + keyboardHeight) + } self.rightButton.snp.updateConstraints { make in make.bottom.equalToSuperview().inset(40 + keyboardHeight) } @@ -205,6 +236,9 @@ public final class AuthCodeViewController: UIViewController, AuthCodeDisplayLogi self.headerImageView.snp.updateConstraints { make in make.top.equalTo(self.view.safeAreaLayoutGuide).inset(46) } + self.leftButton.snp.updateConstraints { make in + make.bottom.equalToSuperview().inset(40) + } self.rightButton.snp.updateConstraints { make in make.bottom.equalToSuperview().inset(40) } From bf6ca1915d4b5eb8ede034ce456fa73c14bbe3ea Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 01:01:10 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=E2=9C=A8=20=EC=97=A0=ED=8B=B0=EB=B7=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contents.json | 15 ++++++ .../ic_guest_list_empty_view.svg | 50 +++++++++++++++++++ .../Sources/Assets/AssetImage.swift | 1 + .../Sources/GuestListViewController.swift | 16 +++++- .../Scene/Sources/View/EmptyView.swift | 37 ++++++++++++++ .../Sources/ProfileRegisterInteractor.swift | 4 +- 6 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg create mode 100644 Projects/Features/GuestList/Targets/Scene/Sources/View/EmptyView.swift diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/Contents.json new file mode 100644 index 0000000..7367236 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_guest_list_empty_view.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg b/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg new file mode 100644 index 0000000..f92b7eb --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/DesignSystem/Sources/Assets/AssetImage.swift b/Projects/DesignSystem/Sources/Assets/AssetImage.swift index 3c3ad93..8eb7e13 100644 --- a/Projects/DesignSystem/Sources/Assets/AssetImage.swift +++ b/Projects/DesignSystem/Sources/Assets/AssetImage.swift @@ -61,6 +61,7 @@ public enum Assets: String { case ic_report case nice_completed case btn_kakao_login + case ic_guest_list_empty_view public var image: UIImage? { let bundle = Bundle(identifier: "kr.mash-up.DesignSystem") diff --git a/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift b/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift index 3420d84..9c970c6 100644 --- a/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift +++ b/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift @@ -136,6 +136,12 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { return v } + private lazy var emptyView: EmptyView = { + let v = EmptyView() + v.isHidden = true + return v + }() + private func getGuestCardViewColor(for index: Int) -> UIColor? { switch index % 4 { case 0: @@ -196,6 +202,7 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { self.view.addSubview(self.secondTitleLabel) self.view.addSubview(self.guestSwipeableView) self.view.addSubview(self.reportButton) + self.view.addSubview(self.emptyView) self.navigationView.addSubview(self.logoImageView) self.navigationView.addSubview(self.likeListButton) self.navigationView.addSubview(self.myInfoButton) @@ -239,6 +246,11 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { make.centerX.equalToSuperview() make.width.height.equalTo(24) } + self.emptyView.snp.makeConstraints { make in + make.top.equalTo(self.navigationView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.bottom.equalTo(self.view.safeAreaLayoutGuide) + } } private func setNotificationCenter() { @@ -260,7 +272,6 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { } default: break - } } // MARK: Display Logic @@ -276,6 +287,9 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { make.top.equalTo(self.secondTitleLabel.snp.bottom).offset(32) make.bottom.equalToSuperview().inset(84) } + self.firstTitleLabel.isHidden = viewModel.guestCardViewModels.isEmpty + self.secondTitleLabel.isHidden = viewModel.guestCardViewModels.isEmpty + self.emptyView.isHidden = !viewModel.guestCardViewModels.isEmpty self.reportButton.isHidden = viewModel.guestCardViewModels.isEmpty } } diff --git a/Projects/Features/GuestList/Targets/Scene/Sources/View/EmptyView.swift b/Projects/Features/GuestList/Targets/Scene/Sources/View/EmptyView.swift new file mode 100644 index 0000000..e827063 --- /dev/null +++ b/Projects/Features/GuestList/Targets/Scene/Sources/View/EmptyView.swift @@ -0,0 +1,37 @@ +// +// EmptyView.swift +// GuestListScene +// +// Created by Woody on 2022/08/26. +// Copyright © 2022 kr.mash-up. All rights reserved. +// + +import DesignSystem +import UIKit + +final class EmptyView: UIView { + lazy var imageView: UIImageView = { + let v = UIImageView(asset: .ic_guest_list_empty_view) + return v + }() + + override init(frame: CGRect) { + super.init(frame: frame) + setUI() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + setUI() + } + + private func setUI() { + self.addSubview(self.imageView) + + self.imageView.snp.makeConstraints { make in + make.center.equalToSuperview().inset(80) + make.width.equalTo(296) + make.height.equalTo(237) + } + } +} diff --git a/Projects/Features/ProfileRegister/Sources/ProfileRegisterInteractor.swift b/Projects/Features/ProfileRegister/Sources/ProfileRegisterInteractor.swift index 4647afd..937242e 100644 --- a/Projects/Features/ProfileRegister/Sources/ProfileRegisterInteractor.swift +++ b/Projects/Features/ProfileRegister/Sources/ProfileRegisterInteractor.swift @@ -37,12 +37,12 @@ class ProfileRegisterInteractor: ProfileRegisterBusinessLogic, ProfileRegisterDa var thirdPartyToken: String? { didSet { -// print(thirdPartyToken) + print(thirdPartyToken) } } var oauthType: String? { didSet { -// print(oauthType) + print(oauthType) } } From 9208ba27cdd4bb4f8fbba34f62a6c67d1e2a87b6 Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 02:00:51 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=ED=85=8D=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Targets/Scene/Sources/GuestDetailViewController.swift | 2 +- .../Targets/Scene/Sources/Views/MyGuestCardView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailViewController.swift b/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailViewController.swift index 83e6912..e87fedf 100644 --- a/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailViewController.swift +++ b/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailViewController.swift @@ -196,7 +196,7 @@ public final class GuestDetailViewController: UIViewController, GuestDetailDispl private let careerDescriptionLabel: UILabel = { $0.font = .subtitle2() $0.textColor = Pallete.Light.grey400.color - $0.text = "로 일해요" + $0.text = "(으)로 일해요" return $0 }(UILabel()) diff --git a/Projects/Features/MyGuestList/Targets/Scene/Sources/Views/MyGuestCardView.swift b/Projects/Features/MyGuestList/Targets/Scene/Sources/Views/MyGuestCardView.swift index c16e55b..a5f9098 100644 --- a/Projects/Features/MyGuestList/Targets/Scene/Sources/Views/MyGuestCardView.swift +++ b/Projects/Features/MyGuestList/Targets/Scene/Sources/Views/MyGuestCardView.swift @@ -92,7 +92,7 @@ final class MyGuestCardView: UIView { private let careerDescriptionLabel: UILabel = { $0.font = .subtitle2() $0.textColor = Pallete.Light.grey200.color - $0.text = "로 일해요" + $0.text = "(으)로 일해요" return $0 }(UILabel()) From 7d4e1802a0e1473ec882e56106f5745ef71f634a Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 02:07:17 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=90=9B=20=EC=97=A0=ED=8B=B0=EB=B7=B0?= =?UTF-8?q?=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=88=98=EC=A0=95=20=EB=B0=8F?= =?UTF-8?q?=20=EB=A1=9C=EA=B3=A0=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic_guest_list_empty_view.svg | 18 +++++++++--------- .../Sources/GuestListViewController.swift | 15 +-------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg b/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg index f92b7eb..74671ee 100644 --- a/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_guest_list_empty_view.imageset/ic_guest_list_empty_view.svg @@ -4,25 +4,25 @@ - + - + - - + + - + - - + + - + - + diff --git a/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift b/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift index 9c970c6..ba2aedb 100644 --- a/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift +++ b/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift @@ -67,13 +67,7 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { let v = UIView() return v }() - - lazy var logoImageView: UIImageView = { - let v = UIImageView() - v.image = .create(.logo) - return v - }() - + lazy var likeListButton: UIImageView = { let v = UIImageView() v.image = .create(.ic_heart) @@ -203,7 +197,6 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { self.view.addSubview(self.guestSwipeableView) self.view.addSubview(self.reportButton) self.view.addSubview(self.emptyView) - self.navigationView.addSubview(self.logoImageView) self.navigationView.addSubview(self.likeListButton) self.navigationView.addSubview(self.myInfoButton) @@ -225,12 +218,6 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { make.top.equalTo(self.secondTitleLabel.snp.bottom).offset(32) make.bottom.equalToSuperview().inset(84) } - self.logoImageView.snp.makeConstraints { make in - make.leading.equalToSuperview().inset(20) - make.centerY.equalToSuperview() - make.height.equalTo(25) - make.width.equalTo(81) - } self.likeListButton.snp.makeConstraints { make in make.height.width.equalTo(40) make.trailing.equalTo(self.myInfoButton.snp.leading) From 942653f85e7b10c2285b024f478ab19db8df1ff5 Mon Sep 17 00:00:00 2001 From: wody-d Date: Fri, 26 Aug 2022 02:24:39 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=E2=9C=A8=20Add=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic_plus_disable.imageset/Contents.json | 15 +++++++++++ .../ic_plus_disable.svg | 4 +++ .../ic_plus_enable.imageset/Contents.json | 15 +++++++++++ .../ic_plus_enable.svg | 4 +++ .../ic_plus_highlight.imageset/Contents.json | 15 +++++++++++ .../ic_plus_highlight.svg | 4 +++ .../Sources/Assets/AssetImage.swift | 3 +++ .../Buttons/Custom/TextImageMTButton.swift | 27 ++++++++++++++++++- .../Sources/Buttons/MTButton.swift | 2 ++ .../Sources/Buttons/MTButtonType.swift | 1 + .../Sources/MeetingListViewController.swift | 2 +- 11 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/ic_plus_disable.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/ic_plus_enable.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/ic_plus_highlight.svg diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/Contents.json new file mode 100644 index 0000000..5cd4b4a --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_plus_disable.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/ic_plus_disable.svg b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/ic_plus_disable.svg new file mode 100644 index 0000000..3ed978d --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_disable.imageset/ic_plus_disable.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/Contents.json new file mode 100644 index 0000000..46b2fe5 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_plus_enable.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/ic_plus_enable.svg b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/ic_plus_enable.svg new file mode 100644 index 0000000..ef8b293 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_enable.imageset/ic_plus_enable.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/Contents.json new file mode 100644 index 0000000..c6a2698 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_plus_highlight.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/ic_plus_highlight.svg b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/ic_plus_highlight.svg new file mode 100644 index 0000000..5596839 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/ic_plus_highlight.imageset/ic_plus_highlight.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Sources/Assets/AssetImage.swift b/Projects/DesignSystem/Sources/Assets/AssetImage.swift index 8eb7e13..9cd7055 100644 --- a/Projects/DesignSystem/Sources/Assets/AssetImage.swift +++ b/Projects/DesignSystem/Sources/Assets/AssetImage.swift @@ -62,6 +62,9 @@ public enum Assets: String { case nice_completed case btn_kakao_login case ic_guest_list_empty_view + case ic_plus_highlight + case ic_plus_enable + case ic_plus_disable public var image: UIImage? { let bundle = Bundle(identifier: "kr.mash-up.DesignSystem") diff --git a/Projects/DesignSystem/Sources/Buttons/Custom/TextImageMTButton.swift b/Projects/DesignSystem/Sources/Buttons/Custom/TextImageMTButton.swift index 67d71fa..c92ca8d 100644 --- a/Projects/DesignSystem/Sources/Buttons/Custom/TextImageMTButton.swift +++ b/Projects/DesignSystem/Sources/Buttons/Custom/TextImageMTButton.swift @@ -65,12 +65,15 @@ extension TextImageMTButton { // MARK: 버튼 타입 public enum CustomButtonType { + case mainPlusDark case mainDark case mainLight case mainSmallDark var contentAttribute: UISemanticContentAttribute { switch self { + case .mainPlusDark: + return .forceRightToLeft case .mainDark: return .forceRightToLeft case .mainLight: @@ -82,6 +85,8 @@ extension TextImageMTButton { var enabledBackgroundColor: UIColor? { switch self { + case .mainPlusDark: + return Pallete.Dark.subGreen.color case .mainDark: return Pallete.Dark.subGreen.color case .mainLight: @@ -93,6 +98,8 @@ extension TextImageMTButton { var disabledBackgroundColor: UIColor? { switch self { + case .mainPlusDark: + return Pallete.Dark.grey300.color case .mainDark: return Pallete.Dark.grey300.color case .mainLight: @@ -104,6 +111,8 @@ extension TextImageMTButton { var enabledTextColor: UIColor? { switch self { + case .mainPlusDark: + return Pallete.Dark.grey800.color case .mainDark: return Pallete.Dark.grey800.color case .mainLight: @@ -115,6 +124,8 @@ extension TextImageMTButton { var disabledTextColor: UIColor? { switch self { + case .mainPlusDark: + return Pallete.Dark.grey200.color case .mainDark: return Pallete.Dark.grey200.color case .mainLight: @@ -130,6 +141,8 @@ extension TextImageMTButton { var highlightedBackgroundColor: UIColor? { switch self { + case .mainPlusDark: + return Pallete.Dark.subGreen.color case .mainDark: return Pallete.Dark.subGreen.color case .mainLight: @@ -141,6 +154,8 @@ extension TextImageMTButton { var enableImage: UIImage? { switch self { + case .mainPlusDark: + return .create(.ic_plus_enable) case .mainDark: return .create(.ic_main_dark_enable) case .mainLight: @@ -152,6 +167,8 @@ extension TextImageMTButton { var highlightImage: UIImage? { switch self { + case .mainPlusDark: + return .create(.ic_plus_highlight) case .mainDark: return .create(.ic_main_dark_highlight) case .mainLight: @@ -163,6 +180,8 @@ extension TextImageMTButton { var disableImage: UIImage? { switch self { + case .mainPlusDark: + return .create(.ic_plus_disable) case .mainDark: return .create(.ic_main_dark_disable) case .mainLight: @@ -174,6 +193,8 @@ extension TextImageMTButton { var imagePadding: CGFloat { switch self { + case .mainPlusDark: + return 22 case .mainDark: return 22 case .mainLight: @@ -185,6 +206,8 @@ extension TextImageMTButton { var contentLeftPadding: CGFloat { switch self { + case .mainPlusDark: + return 36 case .mainDark: return 36 case .mainLight: @@ -196,6 +219,8 @@ extension TextImageMTButton { var contentRightPadding: CGFloat { switch self { + case .mainPlusDark: + return 8 case .mainDark: return 8 case .mainLight: @@ -204,9 +229,9 @@ extension TextImageMTButton { return 24 } } + var imageViewWidth: CGFloat { return 40 } - } } diff --git a/Projects/DesignSystem/Sources/Buttons/MTButton.swift b/Projects/DesignSystem/Sources/Buttons/MTButton.swift index a187fdd..893717e 100644 --- a/Projects/DesignSystem/Sources/Buttons/MTButton.swift +++ b/Projects/DesignSystem/Sources/Buttons/MTButton.swift @@ -36,6 +36,8 @@ extension MTButton { public static func create(_ type: MTButtonType) -> MTButton { switch type { + case .mainPlusDark: + return TextImageMTButton(customButtonType: .mainPlusDark) case .mainDark: return TextImageMTButton(customButtonType: .mainDark) case .mainLight: diff --git a/Projects/DesignSystem/Sources/Buttons/MTButtonType.swift b/Projects/DesignSystem/Sources/Buttons/MTButtonType.swift index bb503b7..63cef74 100644 --- a/Projects/DesignSystem/Sources/Buttons/MTButtonType.swift +++ b/Projects/DesignSystem/Sources/Buttons/MTButtonType.swift @@ -9,6 +9,7 @@ import Foundation public enum MTButtonType { + case mainPlusDark case mainDark case mainLight case mainSmallDark diff --git a/Projects/Features/MeetingList/Targets/Scene/Sources/MeetingListViewController.swift b/Projects/Features/MeetingList/Targets/Scene/Sources/MeetingListViewController.swift index 683f520..deff393 100644 --- a/Projects/Features/MeetingList/Targets/Scene/Sources/MeetingListViewController.swift +++ b/Projects/Features/MeetingList/Targets/Scene/Sources/MeetingListViewController.swift @@ -74,7 +74,7 @@ public final class MeetingListViewController: UIViewController, MeetingListDispl }() lazy var addButton: MTButton = { - let button = MTButton.create(.mainDark) + let button = MTButton.create(.mainPlusDark) button.title = "ADD" button.addTarget(self, action: #selector(didTapAddButton), for: .touchUpInside) return button From 3d683411fdcbeb7dc64e7bb44d14090135b8b9c3 Mon Sep 17 00:00:00 2001 From: wody-d Date: Mon, 29 Aug 2022 12:00:29 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=E2=9C=A8=20GuestDetail=EC=97=90=EC=84=9C?= =?UTF-8?q?=20LikeComplete=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20LikeComplete=EC=97=90=EC=84=9C=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Targets/Router/GuestDetailRouter.swift | 1 + .../GuestDetailDataStore.swift | 1 + .../Scene/Sources/GuestDetailInteractor.swift | 2 ++ .../Targets/Router/GuestListRouter.swift | 1 + .../Sources/GuestListViewController.swift | 24 +++++++++++++++++++ .../Sources/LikeRequestCompleteWorker.swift | 15 ++++++++++-- Projects/Marryting/Sources/AppDelegate.swift | 4 +++- 7 files changed, 45 insertions(+), 3 deletions(-) diff --git a/Projects/Features/GuestDetail/Targets/Router/GuestDetailRouter.swift b/Projects/Features/GuestDetail/Targets/Router/GuestDetailRouter.swift index f297482..66d8c3d 100644 --- a/Projects/Features/GuestDetail/Targets/Router/GuestDetailRouter.swift +++ b/Projects/Features/GuestDetail/Targets/Router/GuestDetailRouter.swift @@ -33,6 +33,7 @@ public final class GuestDetailRouter: GuestDetailRoutingLogic, GuestDetailDataPa } let destinationVC = LikeRequestViewController() + destinationVC.router?.dataStore?.weddingId = dataStore.meetingID destinationVC.router?.dataStore?.targetGuest = guest viewController?.navigationController?.pushViewController(destinationVC, animated: true) } diff --git a/Projects/Features/GuestDetail/Targets/RoutingProtocol/GuestDetailDataStore.swift b/Projects/Features/GuestDetail/Targets/RoutingProtocol/GuestDetailDataStore.swift index 3352a82..9d0a2a3 100644 --- a/Projects/Features/GuestDetail/Targets/RoutingProtocol/GuestDetailDataStore.swift +++ b/Projects/Features/GuestDetail/Targets/RoutingProtocol/GuestDetailDataStore.swift @@ -14,4 +14,5 @@ import Models public protocol GuestDetailDataStore { var targetGuest: Guest? { get set } + var meetingID: Int? { get set } } diff --git a/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailInteractor.swift b/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailInteractor.swift index 2b3fe44..a579d50 100644 --- a/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailInteractor.swift +++ b/Projects/Features/GuestDetail/Targets/Scene/Sources/GuestDetailInteractor.swift @@ -23,6 +23,8 @@ final class GuestDetailInteractor: GuestDetailBusinessLogic, GuestDetailDataStor var targetGuest: Guest? + var meetingID: Int? + init(worker: GuestDetailWorkerProtocol = GuestDetailWorker()) { self.worker = worker } diff --git a/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift b/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift index 60c8353..f8ae0f2 100644 --- a/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift +++ b/Projects/Features/GuestList/Targets/Router/GuestListRouter.swift @@ -51,6 +51,7 @@ public class GuestListRouter: GuestListRoutingLogic, GuestListDataPassing { } let destinationVC = GuestDetailViewController(profileDetailType: .guestProfile) destinationVC.router?.dataStore?.targetGuest = guest + destinationVC.router?.dataStore?.meetingID = dataStore.meetingId viewController?.navigationController?.pushViewController(destinationVC, animated: true) } diff --git a/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift b/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift index ba2aedb..2f7ab16 100644 --- a/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift +++ b/Projects/Features/GuestList/Targets/Scene/Sources/GuestListViewController.swift @@ -136,6 +136,19 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { return v }() +// private lazy var refreshGuestListButton: UIButton = { +// let v = UIButton(type: .system) +// v.setImage(<#T##image: UIImage?##UIImage?#>, for: <#T##UIControl.State#>) +// v.setTitleColor(Pallete.Light.grey500.color, for: .normal) +// v.setTitle("결혼식 변경", for: .normal) +// v.layer.cornerRadius = 8 +// v.layer.borderWidth = 1 +// v.layer.borderColor = Pallete.Light.grey100.color?.cgColor +// v.isHidden = true +// v.addTarget(self, action: #selector(refreshGuestListButtonDidTap), for: .touchUpInside) +// return v +// }() + private func getGuestCardViewColor(for index: Int) -> UIColor? { switch index % 4 { case 0: @@ -167,6 +180,11 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { router?.routeToMyProfile() } +// @objc +// private func refreshGuestListButtonDidTap() { +// interactor?.fetchGuests() +// } + // MARK: View lifecycle public override func viewDidLoad() { @@ -197,6 +215,7 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { self.view.addSubview(self.guestSwipeableView) self.view.addSubview(self.reportButton) self.view.addSubview(self.emptyView) +// self.view.addSubview(self.refreshGuestListButton) self.navigationView.addSubview(self.likeListButton) self.navigationView.addSubview(self.myInfoButton) @@ -238,6 +257,10 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { make.leading.trailing.equalToSuperview() make.bottom.equalTo(self.view.safeAreaLayoutGuide) } +// self.refreshGuestListButton.snp.makeConstraints { make in +// make.top.equalTo(self.emptyView.imageView.snp.bottom).offset(29) +// make.centerX.equalToSuperview() +// } } private func setNotificationCenter() { @@ -277,6 +300,7 @@ public class GuestListViewController: UIViewController, GuestListDisplayLogic { self.firstTitleLabel.isHidden = viewModel.guestCardViewModels.isEmpty self.secondTitleLabel.isHidden = viewModel.guestCardViewModels.isEmpty self.emptyView.isHidden = !viewModel.guestCardViewModels.isEmpty +// self.refreshGuestListButton.isHidden = !viewModel.guestCardViewModels.isEmpty self.reportButton.isHidden = viewModel.guestCardViewModels.isEmpty } } diff --git a/Projects/Features/LikeRequestComplete/Targets/Scene/Sources/LikeRequestCompleteWorker.swift b/Projects/Features/LikeRequestComplete/Targets/Scene/Sources/LikeRequestCompleteWorker.swift index fafb4f4..b558839 100644 --- a/Projects/Features/LikeRequestComplete/Targets/Scene/Sources/LikeRequestCompleteWorker.swift +++ b/Projects/Features/LikeRequestComplete/Targets/Scene/Sources/LikeRequestCompleteWorker.swift @@ -10,14 +10,25 @@ // see http://clean-swift.com // -import UIKit +import DataSource protocol LikeRequestCompleteWorkerProtocol { func getMyName() -> String } final class LikeRequestCompleteWorker: LikeRequestCompleteWorkerProtocol { + + private let userLocalDataSource: UserLocalDataSoureceProtocol + + init( + _ userLocalDataSource: UserLocalDataSoureceProtocol = UserLocalDataSourece() + ) { + self.userLocalDataSource = userLocalDataSource + } + func getMyName() -> String { - "박우인" + guard let user = userLocalDataSource.read(key: .localUser) else { return "" } + return user.name + } } diff --git a/Projects/Marryting/Sources/AppDelegate.swift b/Projects/Marryting/Sources/AppDelegate.swift index c4fb841..4f3bead 100644 --- a/Projects/Marryting/Sources/AppDelegate.swift +++ b/Projects/Marryting/Sources/AppDelegate.swift @@ -22,6 +22,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil ) -> Bool { + for framework in Bundle.allBundles { + print(framework) + } KakaoSDK.initSDK(appKey: "bd614625345b00170f51b167c97e96e9") Font.registerFonts() window = UIWindow(frame: UIScreen.main.bounds) @@ -35,7 +38,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { if (AuthApi.isKakaoTalkLoginUrl(url)) { - print(url.query) return AuthController.handleOpenUrl(url: url) }