From 2a4ab19dc28a6f221d553b224d66eb4f9af9669b Mon Sep 17 00:00:00 2001 From: JinUng41 Date: Sun, 1 Sep 2024 13:42:14 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix/#353=20'+'=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=A4=91=EC=95=99=EC=9C=BC=EB=A1=9C=20=EC=98=A4?= =?UTF-8?q?=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 - ContentInset은 iOS 15.0에서 deprecated 되어 UIButton.Configuration을 이용하여 설정 --- KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift b/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift index 0f9c31b5..3974ae46 100644 --- a/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift +++ b/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift @@ -33,6 +33,9 @@ final class MeetingMemberCell: BaseCollectionViewCell { super.prepareForReuse() profileImageButton.do { + var config = UIButton.Configuration.plain() + config.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0) + $0.imageView?.image = nil $0.backgroundColor = .clear $0.isEnabled = false @@ -89,6 +92,10 @@ private extension MeetingMemberCell { self.delegate = delegate profileImageButton.do { + var config = UIButton.Configuration.plain() + config.contentInsets = NSDirectionalEdgeInsets(top: 5, leading: 0, bottom: 0, trailing: 0) + + $0.configuration = config $0.backgroundColor = .gray1 $0.setImage(.iconPlus.withTintColor(.gray4), for: .normal) $0.isEnabled = true From fab518e753164fd1b41b47cf44ea3c7c20dda463 Mon Sep 17 00:00:00 2001 From: JinUng41 Date: Sun, 1 Sep 2024 13:45:11 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix/#353=20'=EB=AA=A8=EC=9E=84=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EC=9D=BC=20|=20=EB=82=A0=EC=A7=9C'=20=EA=B0=84?= =?UTF-8?q?=EA=B2=A9=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20divider=20?= =?UTF-8?q?=EB=AA=A8=EC=96=91=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 중간에 표현되는 divider를 UILabel로 구현 --- .../View/MeetingInfoBannerView.swift | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift index 529c2b7f..0a90792b 100644 --- a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift +++ b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift @@ -15,7 +15,9 @@ final class MeetingInfoBannerView: BaseView { $0.setText("모임 생성일", style: .label01, color: .gray4) } - private let divider = UIView(backgroundColor: .gray4) + private let divider = UILabel().then { + $0.setText("l", style: .label01, color: .gray4) + } private let createdAtLabel = UILabel().then { $0.setText("2024.06.01", style: .label01, color: .gray4) @@ -40,24 +42,29 @@ final class MeetingInfoBannerView: BaseView { backgroundColor = .lightGreen layer.cornerRadius = 8 - horizontalStackView.addArrangedSubviews(explanationLabel, divider, createdAtLabel) - backgroundImageView.addSubviews(horizontalStackView, metCountLabel) + backgroundImageView.addSubviews(explanationLabel, divider, createdAtLabel, metCountLabel) addSubviews(backgroundImageView) } override func setupAutoLayout() { + explanationLabel.snp.makeConstraints { + $0.top.equalToSuperview().offset(20) + $0.leading.equalToSuperview().offset(16) + } + divider.snp.makeConstraints { - $0.width.equalTo(1) + $0.leading.equalTo(explanationLabel.snp.trailing).offset(12) + $0.centerY.equalTo(explanationLabel) } - horizontalStackView.snp.makeConstraints { - $0.top.equalToSuperview().offset(20) - $0.leading.equalToSuperview().offset(16) + createdAtLabel.snp.makeConstraints { + $0.leading.equalTo(divider.snp.trailing).offset(12) + $0.centerY.equalTo(explanationLabel) } metCountLabel.snp.makeConstraints { - $0.top.equalTo(horizontalStackView.snp.bottom).offset(2) - $0.leading.equalTo(horizontalStackView) + $0.top.equalTo(explanationLabel.snp.bottom).offset(2) + $0.leading.equalTo(explanationLabel) $0.bottom.equalToSuperview().offset(-20) } From 540bc170c3d01a227ae72f644b15551f1d829d4a Mon Sep 17 00:00:00 2001 From: JinUng41 Date: Sun, 1 Sep 2024 13:46:58 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix/#353=20=EC=9A=B0=EC=B8=A1=20=ED=99=94?= =?UTF-8?q?=EC=82=B4=ED=91=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/MeetingInfo/View/MeetingInfoView.swift | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift index e5bf2150..e802e016 100644 --- a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift +++ b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift @@ -57,12 +57,6 @@ final class MeetingInfoView: BaseView { $0.setText("모임 참여 인원 0명", style: .body01, color: .gray8) } - private let arrowButton = UIButton().then { - let image = UIImage(resource: .iconRight).withTintColor(.gray4) - $0.setImage(image, for: .normal) - $0.contentMode = .scaleAspectFill - } - private let createPromiseButton = UIButton(backgroundColor: .maincolor).then { $0.setTitle("+ 약속추가", style: .body01, color: .white) $0.layer.cornerRadius = Screen.height(52) / 2 @@ -102,7 +96,7 @@ final class MeetingInfoView: BaseView { ) emptyDescriptionView.addSubviews(emptyDescriptionLabel) addSubviews( - infoBanner, memberCountLabel, arrowButton, memberListView, createPromiseButton, + infoBanner, memberCountLabel, memberListView, createPromiseButton, grayBackgroundView ) bringSubviewToFront(createPromiseButton) @@ -121,11 +115,6 @@ final class MeetingInfoView: BaseView { $0.leading.equalTo(infoBanner) } - arrowButton.snp.makeConstraints { - $0.trailing.equalToSuperview().offset(-20) - $0.centerY.equalTo(memberCountLabel) - } - memberListView.snp.makeConstraints { $0.top.equalTo(memberCountLabel.snp.bottom).offset(20) $0.horizontalEdges.equalToSuperview() From d7f31edb3f9f0e43b1414f0e57c3390aae98bf22 Mon Sep 17 00:00:00 2001 From: JinUng41 Date: Sun, 1 Sep 2024 13:47:22 +0900 Subject: [PATCH 4/5] =?UTF-8?q?fix/#353=20'D-DAY'=20=EB=8C=80=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EB=A1=9C=20=ED=91=9C=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift b/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift index ad170385..793fa2bb 100644 --- a/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift +++ b/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift @@ -218,7 +218,7 @@ private extension MeetingInfoViewModel { if 0 < dDay { return ("+\(dDay)", .past) } else if 0 == dDay { - return ("-Day", .today) + return ("-DAY", .today) } else { return ("\(dDay)", .future) } From 138a8e8dc90c3e07bc88b445864418ece1432fad Mon Sep 17 00:00:00 2001 From: JinUng41 Date: Sun, 1 Sep 2024 13:47:46 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fix/#353=20'=EB=AA=A8=EC=9E=84=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EC=9D=BC'=20=EC=88=98=EC=A0=95=EB=90=9C=20DateFormat?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/MeetingInfoViewModel.swift | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift b/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift index 793fa2bb..f5ac6d14 100644 --- a/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift +++ b/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift @@ -57,7 +57,33 @@ extension MeetingInfoViewModel: ViewModelType { } .disposed(by: disposeBag) - let info = infoRelay.asDriver(onErrorJustReturn: nil) + let info = infoRelay + .map { info -> MeetingInfoModel? in + guard let info else { + print("MeetingInfoModel이 존재하지 않습니다.") + return nil + } + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + + guard let date = dateFormatter.date(from: info.createdAt) else { + print("서버의 date가 형식에 맞지 않습니다.") + return nil + } + + dateFormatter.dateFormat = "yyyy.MM.dd" + let dateString = dateFormatter.string(from: date) + + return MeetingInfoModel( + meetingID: info.meetingID, + name: info.name, + createdAt: dateString, + metCount: info.metCount, + invitationCode: info.invitationCode + ) + } + .asDriver(onErrorJustReturn: nil) let memberCount = meetingMemberModelRelay .compactMap { $0?.memberCount }