From a8266778c58a5e84c742ef4f3165fe854fa576e7 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:47:00 +0900 Subject: [PATCH 01/24] =?UTF-8?q?#172:=20=EC=9E=AC=EC=B9=98=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EC=9A=B0?= =?UTF-8?q?=EC=84=A0=EC=88=9C=EC=9C=84=EB=B3=84=20=EC=84=A0=ED=83=9D=20Cel?= =?UTF-8?q?l=20~WithRankTableViewCell=20>=20~WithPriorityTableViewCell=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ft => RegisterCategorySelectWithPriorityTableViewCell.swift} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Zatch/Presentation/Cells/RegisterCells/{RegisterCategorySelectWithRankTableViewCell.swift => RegisterCategorySelectWithPriorityTableViewCell.swift} (92%) diff --git a/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithRankTableViewCell.swift b/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift similarity index 92% rename from Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithRankTableViewCell.swift rename to Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift index de53b756..3580fad0 100644 --- a/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithRankTableViewCell.swift +++ b/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift @@ -7,7 +7,7 @@ import UIKit -class RegisterCategorySelectWithRankTableViewCell: BaseTableViewCell { +class RegisterCategorySelectWithPriorityTableViewCell: BaseTableViewCell { let rankLabel = UILabel().then{ $0.setTypoStyleWithSingleLine(typoStyle: .medium14) From 530b7deb2f72295a8e430174a249e6188db74d25 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:47:55 +0900 Subject: [PATCH 02/24] =?UTF-8?q?#172:=20RegisterCategorySelectWithPriorit?= =?UTF-8?q?yTableViewCell=20=EC=9A=B0=EC=84=A0=EC=88=9C=EC=9C=84=20?= =?UTF-8?q?=ED=83=80=EC=9D=B4=ED=8B=80,=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=ED=83=80=EC=9D=B4=ED=8B=80=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...egorySelectWithPriorityTableViewCell.swift | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift b/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift index 3580fad0..f3245072 100644 --- a/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift +++ b/Zatch/Presentation/Cells/RegisterCells/RegisterCategorySelectWithPriorityTableViewCell.swift @@ -9,15 +9,19 @@ import UIKit class RegisterCategorySelectWithPriorityTableViewCell: BaseTableViewCell { - let rankLabel = UILabel().then{ + private let priorityTitle = UILabel().then{ $0.setTypoStyleWithSingleLine(typoStyle: .medium14) } private let mainView = RegisterCategorySelectView() - //MARK: - Helper + override func prepareForReuse() { + priorityTitle.text = "" + mainView.categoryText.text = "" + } + override func hierarchy() { super.hierarchy() - baseView.addSubview(rankLabel) + baseView.addSubview(priorityTitle) baseView.addSubview(mainView) } @@ -28,14 +32,24 @@ class RegisterCategorySelectWithPriorityTableViewCell: BaseTableViewCell { baseView.snp.makeConstraints{ $0.height.equalTo(88) } - rankLabel.snp.makeConstraints{ + priorityTitle.snp.makeConstraints{ $0.top.equalToSuperview().offset(20) $0.leading.equalToSuperview().offset(36) } mainView.snp.makeConstraints{ - $0.top.equalTo(rankLabel.snp.bottom).offset(10) + $0.top.equalTo(priorityTitle.snp.bottom).offset(10) $0.leading.trailing.bottom.equalToSuperview() } } + func setPriorityTitle(section: Int){ + let priority = section + 1 + priorityTitle.text = "\(priority)순위" + } + + func setCategoryTitle(id: Int?){ + let title = id == nil ? "카테고리 선택" : ServiceType.Zatch.getCategoryFromCategories(at: id!).title + mainView.categoryText.text = title + } + } From 7162fd5456317e333ed70c99ecd1c5055a29c223 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:49:21 +0900 Subject: [PATCH 03/24] =?UTF-8?q?#172:=20ProductNameTabeViewCell=20>=20Tex?= =?UTF-8?q?tFieldTabeViewCell=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8F=84=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EA=B8=B0=20=EB=95=8C=EB=AC=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Cell.swift => TextFieldTabeViewCell.swift} | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) rename Zatch/Presentation/Cells/RegisterCells/{ProductNameTabeViewCell.swift => TextFieldTabeViewCell.swift} (69%) diff --git a/Zatch/Presentation/Cells/RegisterCells/ProductNameTabeViewCell.swift b/Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift similarity index 69% rename from Zatch/Presentation/Cells/RegisterCells/ProductNameTabeViewCell.swift rename to Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift index 45d16531..cb19e957 100644 --- a/Zatch/Presentation/Cells/RegisterCells/ProductNameTabeViewCell.swift +++ b/Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift @@ -9,20 +9,31 @@ import UIKit import RxSwift import RxCocoa -class ProductNameTabeViewCell: BaseTableViewCell, DefaultObservable { +class TextFieldTabeViewCell: BaseTableViewCell, DefaultObservable { + enum CellType{ + case myProduct + case firstPriority + case secondPriority + case thirdPriority + case question + } + + var informationType: CellType!{ + didSet{ + textField.placeholder = informationType.placeholder + } + } let disposeBag = DisposeBag() - let registerManager = ZatchRegisterRequestManager.shared + private let registerManager = ZatchRegisterRequestManager.shared //MARK: - UI - let boundaryLine = UIView().then{ + private let boundaryLine = UIView().then{ $0.backgroundColor = .black5 } - - let productNameTextField = UITextField().then{ + private let textField = UITextField().then{ $0.font = UIFont.pretendard(family: .Medium) - $0.placeholder = "상품 이름을 입력해주세요." } override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -37,7 +48,7 @@ class ProductNameTabeViewCell: BaseTableViewCell, DefaultObservable { override func hierarchy(){ super.hierarchy() baseView.addSubview(boundaryLine) - baseView.addSubview(productNameTextField) + baseView.addSubview(textField) } override func layout(){ @@ -57,14 +68,14 @@ class ProductNameTabeViewCell: BaseTableViewCell, DefaultObservable { make.trailing.equalToSuperview().offset(-20) } - productNameTextField.snp.makeConstraints{ make in + textField.snp.makeConstraints{ make in make.leading.equalToSuperview().offset(36) make.centerY.equalToSuperview() } } func bind(){ - let input: Observable = productNameTextField.rx.text.orEmpty.asObservable() + let input: Observable = textField.rx.text.orEmpty.asObservable() input.asDriver(onErrorJustReturn: "") .drive{ self.registerManager.productName = $0 From 0f29b53e07a0a5826945dedf3d43f3a797b267c1 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:50:28 +0900 Subject: [PATCH 04/24] =?UTF-8?q?#172:=20TextFieldTabeViewCell=20informati?= =?UTF-8?q?onType=20=ED=94=84=EB=A1=9C=ED=8D=BC=ED=8B=B0=EB=A1=9C=20CellTy?= =?UTF-8?q?pe=20=EC=84=A4=EC=A0=95=20=ED=86=B5=ED=95=9C=20Observable?= =?UTF-8?q?=EB=A1=9C=20=EA=B0=92=20=EC=9E=90=EB=8F=99=20=EB=B0=94=EC=9D=B8?= =?UTF-8?q?=EB=94=A9=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterCells/TextFieldTabeViewCell.swift | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift b/Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift index cb19e957..0e7ab006 100644 --- a/Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift +++ b/Zatch/Presentation/Cells/RegisterCells/TextFieldTabeViewCell.swift @@ -78,8 +78,37 @@ class TextFieldTabeViewCell: BaseTableViewCell, DefaultObservable { let input: Observable = textField.rx.text.orEmpty.asObservable() input.asDriver(onErrorJustReturn: "") .drive{ - self.registerManager.productName = $0 + self.setProductNameToManager($0) }.disposed(by: disposeBag) } + + private func setProductNameToManager(_ product: String){ + switch informationType{ + case .myProduct: + registerManager.productName = product + return + case .firstPriority: + registerManager.firstPriorityProductName = product + return + case .secondPriority: + registerManager.secondPriorityProductName = product + return + case .thirdPriority: + registerManager.thirdPriorityProductName = product + return + default: + return + } + } + +} + +extension TextFieldTabeViewCell.CellType{ + var placeholder: String{ + switch self{ + case .question: return "제목을 입력해주세요." + default: return "상품 이름을 입력해주세요." + } + } } From 8dfda4d19d3ed58ea38d2dc282b0a2ccba89a0c8 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:51:00 +0900 Subject: [PATCH 05/24] =?UTF-8?q?#172:=20ZatchRegisterRequestManager=20?= =?UTF-8?q?=EC=9E=AC=EC=B9=98=EB=93=B1=EB=A1=9D=20=EB=91=90=EB=B2=88?= =?UTF-8?q?=EC=9E=AC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=8D=BC=ED=8B=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Register/ZatchRegisterRequestManager.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Zatch/Presentation/Utils/Register/ZatchRegisterRequestManager.swift b/Zatch/Presentation/Utils/Register/ZatchRegisterRequestManager.swift index a53a0f13..d94d8573 100644 --- a/Zatch/Presentation/Utils/Register/ZatchRegisterRequestManager.swift +++ b/Zatch/Presentation/Utils/Register/ZatchRegisterRequestManager.swift @@ -18,6 +18,15 @@ class ZatchRegisterRequestManager{ var endDate: String = "" var isOpen: Bool = false + var firstPriorityCategoryId: Int = -1 + var secondPriorityCategoryId: Int = -1 + var thirdPriorityCategoryId: Int = -1 + var firstPriorityProductName: String = "" + var secondPriorityProductName: String = "" + var thirdPriorityProductName: String = "" + var isAnyZatch: Bool = false + var isShare: Bool = false + func initialize(){ categoryId = -1 productName = "" @@ -25,5 +34,14 @@ class ZatchRegisterRequestManager{ buyDate = "" endDate = "" isOpen = false + + firstPriorityCategoryId = -1 + secondPriorityCategoryId = -1 + thirdPriorityCategoryId = -1 + firstPriorityProductName = "" + secondPriorityProductName = "" + thirdPriorityProductName = "" + isAnyZatch = false + isShare = false } } From 8a396849cbf94e1c7d2d5774fc63c2d47dfc0ba5 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:52:46 +0900 Subject: [PATCH 06/24] =?UTF-8?q?#172:=20ZatchRegisterSecondVC=20=EC=B9=B4?= =?UTF-8?q?=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EA=B4=80=EB=A0=A8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=8D=BC=ED=8B=B0=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZatchRegisterSecondViewController.swift | 67 ++++++++----------- 1 file changed, 27 insertions(+), 40 deletions(-) diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift index da714f24..e217e729 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift @@ -11,9 +11,13 @@ class ZatchRegisterSecondViewController: BaseViewController Int { - return section == 0 || isFieldOpen[section] ? 2 : 1 + return section == 0 || isCategoryFieldOpen[section] ? 2 : 1 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if(indexPath.row == 0){ - let cell = tableView.dequeueReusableCell(for: indexPath, cellType: RegisterCategorySelectWithRankTableViewCell.self) - cell.rankLabel.text = "\(indexPath.section + 1)순위" -// cell.categoryText.text = categoryChoose[indexPath.section] ?? "카테고리 선택" + let cell = tableView.dequeueReusableCell(for: indexPath, cellType: RegisterCategorySelectWithPriorityTableViewCell.self).then{ + $0.setPriorityTitle(section: indexPath.section) + $0.setCategoryTitle(id: categoryPriority[indexPath.section]) + } return cell }else{ let cell = tableView.dequeueReusableCell(for: indexPath, cellType: ProductNameTabeViewCell.self) @@ -124,42 +127,26 @@ extension ZatchRegisterSecondViewController: UITableViewDelegate, UITableViewDat func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + //TODO: 키보드 제어... if(isKeyboardOpen){ dismissKeyboardView() - }else{ - if(indexPath.row == 0){ - let sheet = CategorySheetViewController(service: .Zatch).show(in: self) - sheet.completion = { category in - - let cell = tableView.cellForRow(at: indexPath, cellType: RegisterCategorySelectWithRankTableViewCell.self) -// self.categoryChoose[indexPath.section] = category.0 - - if(!self.isFieldOpen[indexPath.section]){ - self.isFieldOpen[indexPath.section] = true - } - - self.mainView.tableView.reloadData() - - if(indexPath.section == 2){ - self.mainView.tableView.scrollToRow(at: [2,1], at: .bottom, animated: true) - } - } - } + return } - } -} - -extension ZatchRegisterSecondViewController: UITextFieldDelegate{ - - func textFieldDidBeginEditing(_ textField: UITextField) { - if(textField.tag == 2){ - UIView.animate(withDuration: 0.3){ - self.view.window?.frame.origin.y -= 80 + if(indexPath.row == 0){ + let sheet = CategorySheetViewController(service: .Zatch).show(in: self) + sheet.completion = { categoryId in + + let cell = tableView.cellForRow(at: indexPath, cellType: RegisterCategorySelectWithPriorityTableViewCell.self).then{ + $0.setCategoryTitle(id: categoryId) + } + self.categoryPriority[indexPath.section] = categoryId + self.isCategoryFieldOpen[indexPath.section] = true + + if(indexPath.section == 2){ + self.mainView.tableView.scrollToRow(at: [2,1], at: .bottom, animated: true) + } } } - - self.isKeyboardOpen = true } - } From 266eba45f06121dad44069227e130c95981db061 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 17:53:38 +0900 Subject: [PATCH 07/24] =?UTF-8?q?#172:=20ZatchRegisterSecondViewController?= =?UTF-8?q?=20getTextFieldCellType=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=ED=86=B5=ED=95=9C=20TextFieldTabeViewCell=EC=97=90=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EB=B0=94=EC=9D=B8=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch.xcodeproj/project.pbxproj | 16 ++++++++-------- .../QnA/RegisterQuestionViewController.swift | 8 ++++---- .../Zatch/ZatchRegisterFirstViewController.swift | 2 +- .../ZatchRegisterSecondViewController.swift | 16 +++++++++++++--- .../RegisterView/ZatchRegisterFirstView.swift | 2 +- .../RegisterView/ZatchRegisterSecondView.swift | 4 ++-- 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Zatch.xcodeproj/project.pbxproj b/Zatch.xcodeproj/project.pbxproj index 3f716ae2..307b1741 100644 --- a/Zatch.xcodeproj/project.pbxproj +++ b/Zatch.xcodeproj/project.pbxproj @@ -128,7 +128,7 @@ 57468AA028A214FD00056691 /* UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57468A9F28A214FD00056691 /* UILabel.swift */; }; 57468AA228A21D1700056691 /* TownSettingSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57468AA128A21D1700056691 /* TownSettingSheetViewController.swift */; }; 57468AAC28A3A3AA00056691 /* WhitePurpleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57468AAB28A3A3AA00056691 /* WhitePurpleButton.swift */; }; - 57468AAE28A3A58900056691 /* RegisterCategorySelectWithRankTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57468AAD28A3A58900056691 /* RegisterCategorySelectWithRankTableViewCell.swift */; }; + 57468AAE28A3A58900056691 /* RegisterCategorySelectWithPriorityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57468AAD28A3A58900056691 /* RegisterCategorySelectWithPriorityTableViewCell.swift */; }; 574E1CA9296400E6005D2048 /* CellReuse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574E1CA8296400E6005D2048 /* CellReuse.swift */; }; 574E1CAC2964011D005D2048 /* TypoDesignSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574E1CAB2964011D005D2048 /* TypoDesignSystem.swift */; }; 574EC1ED282E62A000E3CE4B /* RegisterCategorySelectTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574EC1EC282E62A000E3CE4B /* RegisterCategorySelectTableViewCell.swift */; }; @@ -239,7 +239,7 @@ 57B32C362920C5320018C0CB /* CategoryInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B32C352920C5320018C0CB /* CategoryInfo.swift */; }; 57B32C3829220EA10018C0CB /* BottomSheetSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B32C3729220EA10018C0CB /* BottomSheetSystem.swift */; }; 57B32C3A292261D30018C0CB /* AlertInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B32C39292261D30018C0CB /* AlertInfo.swift */; }; - 57B5D6D328346AB100EA1439 /* ProductNameTabeViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B5D6D228346AB100EA1439 /* ProductNameTabeViewCell.swift */; }; + 57B5D6D328346AB100EA1439 /* TextFieldTabeViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B5D6D228346AB100EA1439 /* TextFieldTabeViewCell.swift */; }; 57B5D6D6283475EA00EA1439 /* ImageAddTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B5D6D5283475EA00EA1439 /* ImageAddTableViewCell.swift */; }; 57B9F70C28D94B7800ACEC94 /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B9F70B28D94B7800ACEC94 /* Delegate.swift */; }; 57C23CCD28B1D93E006E7915 /* ChatEtcBtnView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57C23CCC28B1D93E006E7915 /* ChatEtcBtnView.swift */; }; @@ -459,7 +459,7 @@ 57468A9F28A214FD00056691 /* UILabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UILabel.swift; sourceTree = ""; }; 57468AA128A21D1700056691 /* TownSettingSheetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TownSettingSheetViewController.swift; sourceTree = ""; }; 57468AAB28A3A3AA00056691 /* WhitePurpleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhitePurpleButton.swift; sourceTree = ""; }; - 57468AAD28A3A58900056691 /* RegisterCategorySelectWithRankTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterCategorySelectWithRankTableViewCell.swift; sourceTree = ""; }; + 57468AAD28A3A58900056691 /* RegisterCategorySelectWithPriorityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterCategorySelectWithPriorityTableViewCell.swift; sourceTree = ""; }; 574E1CA8296400E6005D2048 /* CellReuse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellReuse.swift; sourceTree = ""; }; 574E1CAB2964011D005D2048 /* TypoDesignSystem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypoDesignSystem.swift; sourceTree = ""; }; 574EC1EC282E62A000E3CE4B /* RegisterCategorySelectTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterCategorySelectTableViewCell.swift; sourceTree = ""; }; @@ -584,7 +584,7 @@ 57B32C352920C5320018C0CB /* CategoryInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryInfo.swift; sourceTree = ""; }; 57B32C3729220EA10018C0CB /* BottomSheetSystem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomSheetSystem.swift; sourceTree = ""; }; 57B32C39292261D30018C0CB /* AlertInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertInfo.swift; sourceTree = ""; }; - 57B5D6D228346AB100EA1439 /* ProductNameTabeViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductNameTabeViewCell.swift; sourceTree = ""; }; + 57B5D6D228346AB100EA1439 /* TextFieldTabeViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldTabeViewCell.swift; sourceTree = ""; }; 57B5D6D5283475EA00EA1439 /* ImageAddTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageAddTableViewCell.swift; sourceTree = ""; }; 57B9F70B28D94B7800ACEC94 /* Delegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Delegate.swift; sourceTree = ""; }; 57C23CCC28B1D93E006E7915 /* ChatEtcBtnView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatEtcBtnView.swift; sourceTree = ""; }; @@ -1100,8 +1100,8 @@ children = ( EE73C5182995FB0B0000F8AC /* DetailInput */, 574EC1EC282E62A000E3CE4B /* RegisterCategorySelectTableViewCell.swift */, - 57468AAD28A3A58900056691 /* RegisterCategorySelectWithRankTableViewCell.swift */, - 57B5D6D228346AB100EA1439 /* ProductNameTabeViewCell.swift */, + 57468AAD28A3A58900056691 /* RegisterCategorySelectWithPriorityTableViewCell.swift */, + 57B5D6D228346AB100EA1439 /* TextFieldTabeViewCell.swift */, 57B5D6D5283475EA00EA1439 /* ImageAddTableViewCell.swift */, 5767D786286ADA4D0075DB28 /* ProductDetailInputTableViewCell.swift */, 57EBCE3828A7CD3800212D20 /* ImageRegisterCollectionViewCell.swift */, @@ -2382,7 +2382,7 @@ 57B32C2E291F49DC0018C0CB /* ZatchRegisterSecondView.swift in Sources */, 5722460C28BF79D1009B7C78 /* MakeMeetingSheetViewController.swift in Sources */, 23B051C528E206C5005D08EA /* MyQuestionsViewController.swift in Sources */, - 57B5D6D328346AB100EA1439 /* ProductNameTabeViewCell.swift in Sources */, + 57B5D6D328346AB100EA1439 /* TextFieldTabeViewCell.swift in Sources */, 23A86A5B28C73D8600B073CB /* MainCollectionViewTableViewCell.swift in Sources */, 23B7FBB228CED37D0018642E /* TownSettingTableViewCell.swift in Sources */, 23B051C328E206B7005D08EA /* RegisterQuestionViewController.swift in Sources */, @@ -2469,7 +2469,7 @@ 233DDF6028EB7D2C008E32B4 /* NanumTableViewCell.swift in Sources */, 5722462728C778E0009B7C78 /* SearchAddressResultView.swift in Sources */, 5767D783286962BC0075DB28 /* SimilarZatchCollectionViewCell.swift in Sources */, - 57468AAE28A3A58900056691 /* RegisterCategorySelectWithRankTableViewCell.swift in Sources */, + 57468AAE28A3A58900056691 /* RegisterCategorySelectWithPriorityTableViewCell.swift in Sources */, 57468A6E289CFFB700056691 /* CategorySheetViewController.swift in Sources */, 57397FC9296FBD7C0088B5F4 /* GatchSearchViewController.swift in Sources */, 576B375D28D82EAF00EF36E6 /* SettingView.swift in Sources */, diff --git a/Zatch/Presentation/ViewControllers/QnA/RegisterQuestionViewController.swift b/Zatch/Presentation/ViewControllers/QnA/RegisterQuestionViewController.swift index 8de5092e..90392a02 100644 --- a/Zatch/Presentation/ViewControllers/QnA/RegisterQuestionViewController.swift +++ b/Zatch/Presentation/ViewControllers/QnA/RegisterQuestionViewController.swift @@ -30,7 +30,7 @@ class RegisterQuestionViewController: UIViewController { $0.delegate = self $0.dataSource = self $0.register(RegisterCategorySelectTableViewCell.self, forCellReuseIdentifier: RegisterCategorySelectTableViewCell.cellIdentifier) - $0.register(ProductNameTabeViewCell.self, forCellReuseIdentifier: ProductNameTabeViewCell.cellIdentifier) + $0.register(TextFieldTabeViewCell.self, forCellReuseIdentifier: TextFieldTabeViewCell.cellIdentifier) $0.register(QuestionContentTableViewCell.self, forCellReuseIdentifier: QuestionContentTableViewCell.cellIdentifier) // autoHeight @@ -97,9 +97,9 @@ extension RegisterQuestionViewController: UITableViewDelegate, UITableViewDataSo guard let cell = tableView.dequeueReusableCell(withIdentifier: RegisterCategorySelectTableViewCell.cellIdentifier, for: indexPath) as? RegisterCategorySelectTableViewCell else{ fatalError("Cell Casting Error")} return cell case 1: - guard let cell = tableView.dequeueReusableCell(withIdentifier: ProductNameTabeViewCell.cellIdentifier, for: indexPath) as? ProductNameTabeViewCell else{ fatalError("Cell Casting Error")} - cell.productNameTextField.placeholder = "제목을 입력해주세요." - cell.productNameTextField.addTarget(self, action: #selector(titleTextFieldEditingChanged), for: .editingChanged) + guard let cell = tableView.dequeueReusableCell(withIdentifier: TextFieldTabeViewCell.cellIdentifier, for: indexPath) as? TextFieldTabeViewCell else{ fatalError("Cell Casting Error")} + cell.informationType = .question +// cell.productNameTextField.addTarget(self, action: #selector(titleTextFieldEditingChanged), for: .editingChanged) cell.selectionStyle = .none return cell case 2: diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift index 5cc2b3b5..bcc70a68 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift @@ -124,7 +124,7 @@ extension ZatchRegisterFirstViewController: UITableViewDelegate, UITableViewData let cell = tableView.dequeueReusableCell(for: indexPath, cellType: RegisterCategorySelectTableViewCell.self) return cell case 1: - let cell = tableView.dequeueReusableCell(for: indexPath, cellType: ProductNameTabeViewCell.self) + let cell = tableView.dequeueReusableCell(for: indexPath, cellType: TextFieldTabeViewCell.self) return cell case 2: let cell = tableView.dequeueReusableCell(for: indexPath, cellType: ImageAddTableViewCell.self) diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift index e217e729..125d88cd 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift @@ -118,13 +118,23 @@ extension ZatchRegisterSecondViewController: UITableViewDelegate, UITableViewDat } return cell }else{ - let cell = tableView.dequeueReusableCell(for: indexPath, cellType: ProductNameTabeViewCell.self) - cell.productNameTextField.delegate = self - cell.productNameTextField.tag = indexPath.section + let cell = tableView.dequeueReusableCell(for: indexPath, cellType: TextFieldTabeViewCell.self) + getTextFieldCellType(section: indexPath.section){ + cell.informationType = $0 + } return cell } } + private func getTextFieldCellType(section: Int, closure: (TextFieldTabeViewCell.CellType) -> Void){ + switch section{ + case 0: closure(.firstPriority); return + case 1: closure(.secondPriority); return + case 2: closure(.thirdPriority); return + default: return + } + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { //TODO: 키보드 제어... diff --git a/Zatch/Presentation/Views/RegisterView/ZatchRegisterFirstView.swift b/Zatch/Presentation/Views/RegisterView/ZatchRegisterFirstView.swift index f4b6d29a..06cb3b8f 100644 --- a/Zatch/Presentation/Views/RegisterView/ZatchRegisterFirstView.swift +++ b/Zatch/Presentation/Views/RegisterView/ZatchRegisterFirstView.swift @@ -19,7 +19,7 @@ class ZatchRegisterFirstView: BaseView { $0.isScrollEnabled = false $0.register(RegisterCategorySelectTableViewCell.self, forCellReuseIdentifier: RegisterCategorySelectTableViewCell.cellIdentifier) - $0.register(ProductNameTabeViewCell.self, forCellReuseIdentifier: ProductNameTabeViewCell.cellIdentifier) + $0.register(TextFieldTabeViewCell.self, forCellReuseIdentifier: TextFieldTabeViewCell.cellIdentifier) $0.register(ImageAddTableViewCell.self, forCellReuseIdentifier: ImageAddTableViewCell.cellIdentifier) $0.register(ProductDetailInputTableViewCell.self, forCellReuseIdentifier: ProductDetailInputTableViewCell.cellIdentifier) } diff --git a/Zatch/Presentation/Views/RegisterView/ZatchRegisterSecondView.swift b/Zatch/Presentation/Views/RegisterView/ZatchRegisterSecondView.swift index d5f44a2c..644817a0 100644 --- a/Zatch/Presentation/Views/RegisterView/ZatchRegisterSecondView.swift +++ b/Zatch/Presentation/Views/RegisterView/ZatchRegisterSecondView.swift @@ -18,8 +18,8 @@ class ZatchRegisterSecondView: BaseView { var tableView = UITableView().then{ $0.showsVerticalScrollIndicator = false - $0.register(cellType: RegisterCategorySelectWithRankTableViewCell.self) - $0.register(cellType: ProductNameTabeViewCell.self) + $0.register(cellType: RegisterCategorySelectWithPriorityTableViewCell.self) + $0.register(cellType: TextFieldTabeViewCell.self) } let radioButtonFrame = UIStackView().then{ From 9b8e2eb383c6b773ab670b133a7d7ad059877f2c Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Fri, 10 Feb 2023 21:36:14 +0900 Subject: [PATCH 08/24] =?UTF-8?q?#172:=20ZatchRegisterSecondViewController?= =?UTF-8?q?=20=ED=82=A4=EB=B3=B4=EB=93=9C=20appear/disappear=20=EC=A0=9C?= =?UTF-8?q?=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZatchRegisterFirstViewController.swift | 4 ++ .../ZatchRegisterSecondViewController.swift | 72 ++++++++++++------- 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift index bcc70a68..911b4e5e 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift @@ -37,6 +37,10 @@ class ZatchRegisterFirstViewController: BaseViewController, with event: UIEvent?) { - dismissKeyboardView() + private func addKeyboardNotifications() { + NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillAppear(noti:)), name: UIResponder.keyboardWillShowNotification , object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillDisappear), name: UIResponder.keyboardWillHideNotification, object: nil) + } + + private func removeKeyboardNotifications() { + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) + } + + @objc private func keyboardWillAppear(noti: NSNotification) { + + isKeyboardOpen = true + + /* + if let keyboardFrame: NSValue = noti.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue { + UIView.animate( + withDuration: 0.3 + , animations: { + self.view.transform = CGAffineTransform(translationX: 0, y: -60) + } + ) + } + */ + } + + @objc private func keyboardWillDisappear() { + isKeyboardOpen = false + self.view.transform = .identity } @objc func radioButtonDidSelected(_ sender: UITapGestureRecognizer){ @@ -83,19 +118,6 @@ class ZatchRegisterSecondViewController: BaseViewController Void){ @@ -137,19 +159,19 @@ extension ZatchRegisterSecondViewController: UITableViewDelegate, UITableViewDat func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - //TODO: 키보드 제어... if(isKeyboardOpen){ - dismissKeyboardView() + self.view.endEditing(true) return } if(indexPath.row == 0){ + let sheet = CategorySheetViewController(service: .Zatch).show(in: self) sheet.completion = { categoryId in - - let cell = tableView.cellForRow(at: indexPath, cellType: RegisterCategorySelectWithPriorityTableViewCell.self).then{ + _ = tableView.cellForRow(at: indexPath, cellType: RegisterCategorySelectWithPriorityTableViewCell.self).then{ $0.setCategoryTitle(id: categoryId) } + self.categoryPriority[indexPath.section] = categoryId self.isCategoryFieldOpen[indexPath.section] = true From 23184b51b4a9900c5876884a11e2d9b250dba533 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:01:31 +0900 Subject: [PATCH 09/24] =?UTF-8?q?#171:=20ZatchComponent=20Util=20=EC=9A=94?= =?UTF-8?q?=EC=86=8C=EB=A1=9C=20Padding=20=EA=B5=AC=EC=A1=B0=EC=B2=B4=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 --- Zatch.xcodeproj/project.pbxproj | 28 +++++++++++++++++++ .../Source/Component/Util/Padding.swift | 23 +++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Zatch/Global/Source/Component/Util/Padding.swift diff --git a/Zatch.xcodeproj/project.pbxproj b/Zatch.xcodeproj/project.pbxproj index 307b1741..3f49318c 100644 --- a/Zatch.xcodeproj/project.pbxproj +++ b/Zatch.xcodeproj/project.pbxproj @@ -314,6 +314,9 @@ EEB13B8D297FC68B001A8DD9 /* UIButton+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEB13B8C297FC68B001A8DD9 /* UIButton+Rx.swift */; }; EEB13B91297FC7A1001A8DD9 /* BaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEB13B90297FC7A1001A8DD9 /* BaseViewModel.swift */; }; EEB13B94297FCD0A001A8DD9 /* LifeCycle+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEB13B93297FCD0A001A8DD9 /* LifeCycle+Rx.swift */; }; + EEE6D15829973C1C0004FC7B /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15729973C1C0004FC7B /* Tag.swift */; }; + EEE6D15B299752EB0004FC7B /* TagStlye.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15A299752EB0004FC7B /* TagStlye.swift */; }; + EEE6D15E299757EF0004FC7B /* Padding.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15D299757EF0004FC7B /* Padding.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -662,6 +665,9 @@ EEB13B8C297FC68B001A8DD9 /* UIButton+Rx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Rx.swift"; sourceTree = ""; }; EEB13B90297FC7A1001A8DD9 /* BaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewModel.swift; sourceTree = ""; }; EEB13B93297FCD0A001A8DD9 /* LifeCycle+Rx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LifeCycle+Rx.swift"; sourceTree = ""; }; + EEE6D15729973C1C0004FC7B /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + EEE6D15A299752EB0004FC7B /* TagStlye.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagStlye.swift; sourceTree = ""; }; + EEE6D15D299757EF0004FC7B /* Padding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Padding.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1933,6 +1939,8 @@ isa = PBXGroup; children = ( EE33D21D2993E1120020866E /* ZatchComponent.swift */, + EEE6D15C299757E20004FC7B /* Util */, + EEE6D159299752E00004FC7B /* Tag */, EE33D21B2993BF710020866E /* LettersAndArrowView.swift */, EE9B053429953A1200068503 /* FilterView.swift */, EE73C52129961BF30000F8AC /* RadioButtonView.swift */, @@ -2018,6 +2026,23 @@ path = RxSwift; sourceTree = ""; }; + EEE6D159299752E00004FC7B /* Tag */ = { + isa = PBXGroup; + children = ( + EEE6D15A299752EB0004FC7B /* TagStlye.swift */, + EEE6D15729973C1C0004FC7B /* Tag.swift */, + ); + path = Tag; + sourceTree = ""; + }; + EEE6D15C299757E20004FC7B /* Util */ = { + isa = PBXGroup; + children = ( + EEE6D15D299757EF0004FC7B /* Padding.swift */, + ); + path = Util; + sourceTree = ""; + }; FEF7190B609B082475C22250 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -2343,6 +2368,7 @@ 5722461B28C6C89A009B7C78 /* SearchAddressView.swift in Sources */, 57B9F70C28D94B7800ACEC94 /* Delegate.swift in Sources */, 57600C092963076E00A7F27B /* GatchDetailViewController.swift in Sources */, + EEE6D15829973C1C0004FC7B /* Tag.swift in Sources */, 57A28B3B28CED8DF00263079 /* SplashTownViewController.swift in Sources */, 57D6D78F28CDB62000F805B7 /* InfoAlertViewController.swift in Sources */, 5724EC91291E122F00DC529B /* BaseView.swift in Sources */, @@ -2531,6 +2557,7 @@ 57D6D7A328CDC32200F805B7 /* KakaoLocalTownModel.swift in Sources */, 57F68BAA29652ED300DB1471 /* DetailEtcBottomSheetView.swift in Sources */, 57468A8E289FEF1800056691 /* WantZatchSheetViewController.swift in Sources */, + EEE6D15E299757EF0004FC7B /* Padding.swift in Sources */, 23A767F629085258003E46AB /* NoticeTableViewCell.swift in Sources */, 5752F1FA28200B8C004CA4A5 /* ResultTableViewCell.swift in Sources */, 57C585042821F2A70078FAFF /* ServiceType.swift in Sources */, @@ -2552,6 +2579,7 @@ 5767D77D286944FB0075DB28 /* BottomFixView.swift in Sources */, 23B051C828E20BE1005D08EA /* QuestionContentTableViewCell.swift in Sources */, 57EBCE3928A7CD3800212D20 /* ImageRegisterCollectionViewCell.swift in Sources */, + EEE6D15B299752EB0004FC7B /* TagStlye.swift in Sources */, 571DADC7297BAE030079CCD3 /* BaseTabBarHeaderView.swift in Sources */, 5724EB61290FC1BB00DC529B /* ModifyMeetingAlertController.swift in Sources */, EEB13B8B297FBBAE001A8DD9 /* DefaultObservablel.swift in Sources */, diff --git a/Zatch/Global/Source/Component/Util/Padding.swift b/Zatch/Global/Source/Component/Util/Padding.swift new file mode 100644 index 00000000..a6e6c5eb --- /dev/null +++ b/Zatch/Global/Source/Component/Util/Padding.swift @@ -0,0 +1,23 @@ +// +// Padding.swift +// Zatch +// +// Created by 박소윤 on 2023/02/11. +// + +import Foundation + +extension ZatchComponent{ + struct Padding{ + let left: CGFloat + let right: CGFloat + let top: CGFloat + let bottom: CGFloat + } +} + +extension ZatchComponent.Padding{ + var inset: UIEdgeInsets{ + UIEdgeInsets(top: self.top, left: self.left, bottom: self.bottom, right: self.right) + } +} From ce4c5e9f52e1b6ac9c27f9a2521df133e5bce340 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:02:44 +0900 Subject: [PATCH 10/24] =?UTF-8?q?#171:=20Tag=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80=20>=20=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EC=A6=88=EB=B3=84=20=EA=B4=80=EB=A6=AC=20=EC=98=88=EC=A0=95,?= =?UTF-8?q?=20Purple/Yellow=20=EC=BC=80=EC=9D=B4=EC=8A=A4=20=EC=A1=B4?= =?UTF-8?q?=EC=9E=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch/Global/Source/Component/Tag/Tag.swift | 101 ++++++++++++++++++ .../Source/Component/Tag/TagStlye.swift | 83 ++++++++++++++ .../Source/Component/ZatchComponent.swift | 2 +- 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 Zatch/Global/Source/Component/Tag/Tag.swift create mode 100644 Zatch/Global/Source/Component/Tag/TagStlye.swift diff --git a/Zatch/Global/Source/Component/Tag/Tag.swift b/Zatch/Global/Source/Component/Tag/Tag.swift new file mode 100644 index 00000000..f3b7b6b3 --- /dev/null +++ b/Zatch/Global/Source/Component/Tag/Tag.swift @@ -0,0 +1,101 @@ +// +// Tag.swift +// Zatch +// +// Created by 박소윤 on 2023/02/11. +// + +import Foundation + +extension ZatchComponent{ + + class PurlpleTag: Tag{ + + init(configuration: ZatchComponent.Tag.TagType){ + super.init(color: .purple, configuration: configuration) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + } + + class YellowTag: Tag{ + + init(configuration: ZatchComponent.Tag.TagType){ + super.init(color: .purple, configuration: configuration) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + } + + class Tag: UILabel{ + + var isSelected = false{ + didSet{ + isSelected ? setSelectState() : setNormalState() + } + } + + private let configuration: TagType + private let colorType: TagColor + + init(color: TagColor, configuration: TagType){ + self.colorType = color + self.configuration = configuration + super.init(frame: .zero) + initialize() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func drawText(in rect: CGRect) { + let inset = configuration.padding.inset + super.drawText(in: rect.inset(by: inset)) + } + + override var intrinsicContentSize: CGSize{ + let padding = configuration.padding + var contentSize = super.intrinsicContentSize + contentSize.height += padding.top + padding.bottom + contentSize.width += padding.left + padding.right + return contentSize + } + + private func initialize(){ + style() + layout() + setNormalState() + } + + private func style(){ + self.layer.cornerRadius = configuration.height / 2 + self.clipsToBounds = true + self.setTypoStyleWithSingleLine(typoStyle: configuration.font) + } + + private func layout(){ + self.snp.makeConstraints{ + $0.height.equalTo(configuration.height) + } + } + + private func setNormalState(){ + self.textColor = colorType.textColor + self.backgroundColor = colorType.backgroundColor + } + + private func setSelectState(){ + self.textColor = colorType.selectedTextColor + self.backgroundColor = colorType.selectedBackgroundColor + } + + func setTitle(_ title: String){ + self.text = title + } + } +} diff --git a/Zatch/Global/Source/Component/Tag/TagStlye.swift b/Zatch/Global/Source/Component/Tag/TagStlye.swift new file mode 100644 index 00000000..28f5fd59 --- /dev/null +++ b/Zatch/Global/Source/Component/Tag/TagStlye.swift @@ -0,0 +1,83 @@ +// +// TagStlye.swift +// Zatch +// +// Created by 박소윤 on 2023/02/11. +// + +import Foundation + +extension ZatchComponent.Tag{ + + enum TagColor{ + case purple + case yellow + } + + enum TagType{ + case height20 + } +} + +extension ZatchComponent.Tag.TagColor{ + + struct TagColorStyle{ + let textColor: UIColor + let backgroundColor: UIColor + let selectedTextColor: UIColor = .white + let selectedBackgroundColor: UIColor + } + + private var colorInfo: TagColorStyle{ + switch self{ + case .purple: + return TagColorStyle(textColor: .zatchPurple, + backgroundColor: .purple40, + selectedBackgroundColor: .zatchPurple) + case .yellow: + return TagColorStyle(textColor: .zatchDeepYellow, + backgroundColor: .yellow40, + selectedBackgroundColor: .zatchDeepYellow) + } + } + + var textColor: UIColor{ + colorInfo.textColor + } + + var backgroundColor: UIColor{ + colorInfo.backgroundColor + } + + var selectedTextColor: UIColor{ + colorInfo.selectedTextColor + } + + var selectedBackgroundColor: UIColor{ + colorInfo.selectedBackgroundColor + } +} + +extension ZatchComponent.Tag.TagType{ + + var padding: ZatchComponent.Padding{ + switch self{ + case .height20: return ZatchComponent.Padding(left: 8, right: 8, top: 0, bottom: 0) + default: return ZatchComponent.Padding(left: 0, right: 0, top: 0, bottom: 0) + } + } + + var font: TypoStyle{ + switch self{ + case .height20: return .medium12 + default: return .medium12 + } + } + + var height: CGFloat{ + switch self{ + case .height20: return 20 + default: return 20 + } + } +} diff --git a/Zatch/Global/Source/Component/ZatchComponent.swift b/Zatch/Global/Source/Component/ZatchComponent.swift index 95564174..9af28695 100644 --- a/Zatch/Global/Source/Component/ZatchComponent.swift +++ b/Zatch/Global/Source/Component/ZatchComponent.swift @@ -8,5 +8,5 @@ import Foundation class ZatchComponent{ - + } From 90552f51de40f1676593c991dbe00f2c428ee318 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:03:30 +0900 Subject: [PATCH 11/24] =?UTF-8?q?#172:=20CheckExchangeRegisterVC=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9E=90=20=ED=86=B5=ED=95=9C=20CheckView=20?= =?UTF-8?q?infoFrame=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Zatch/CheckExchangeRegisterViewController.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift index 65287aa6..8ba6c5ff 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift @@ -9,11 +9,12 @@ import UIKit class CheckExchangeRegisterViewController: CheckRegisterViewController { - override func viewDidLoad() { - - super.viewDidLoad() - - mainView.infoFrame = CheckExchangeRegisterView() + init(){ + super.init(infoView: CheckExchangeRegisterView()) } - + + required init?(coder: NSCoder) { + super.init(infoView: CheckExchangeRegisterView()) + } + } From 77bdd2dac0cdaa9b9c1a3e1b46d18c6fab2f89c2 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:04:04 +0900 Subject: [PATCH 12/24] =?UTF-8?q?#172:=20CheckShareRegisterVC=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EC=9E=90=20=ED=86=B5=ED=95=9C=20CheckView=20infoframe?= =?UTF-8?q?=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Zatch/CheckShareRegisterViewController.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckShareRegisterViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckShareRegisterViewController.swift index 2e89f0a3..bc973aa5 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckShareRegisterViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckShareRegisterViewController.swift @@ -9,11 +9,12 @@ import UIKit class CheckShareRegisterViewController: CheckRegisterViewController { - override func viewDidLoad() { - - super.viewDidLoad() - - mainView.infoFrame = CheckShareRegisterView() + init(){ + super.init(infoView: CheckShareRegisterView()) } - + + required init?(coder: NSCoder) { + super.init(infoView: CheckShareRegisterView()) + } + } From c24d6114ce79ae9708d234652be290d5a16ddfb5 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:34:39 +0900 Subject: [PATCH 13/24] =?UTF-8?q?fix:=20YellowTag=20color=EA=B0=92=20yello?= =?UTF-8?q?w=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch/Global/Source/Component/Tag/Tag.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zatch/Global/Source/Component/Tag/Tag.swift b/Zatch/Global/Source/Component/Tag/Tag.swift index f3b7b6b3..f4bad6c1 100644 --- a/Zatch/Global/Source/Component/Tag/Tag.swift +++ b/Zatch/Global/Source/Component/Tag/Tag.swift @@ -23,7 +23,7 @@ extension ZatchComponent{ class YellowTag: Tag{ init(configuration: ZatchComponent.Tag.TagType){ - super.init(color: .purple, configuration: configuration) + super.init(color: .yellow, configuration: configuration) } required init?(coder: NSCoder) { From a2b68ba11aa579a57ce70ee9fb615f200e7a5bf1 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:36:12 +0900 Subject: [PATCH 14/24] =?UTF-8?q?#172:=20CheckRegisterView=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EC=9E=90=20=ED=86=B5=ED=95=9C=20infoFrame=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterView/CheckRegisterView.swift | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift b/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift index 02061366..63566ee1 100644 --- a/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift +++ b/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift @@ -8,7 +8,16 @@ import UIKit class CheckRegisterView: BaseView { - + + init(infoView: BaseView){ + self.infoFrame = infoView + super.init(frame: .zero) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + //MARK: - Properties static let placeHolder = "추가 설명이 필요하다면 여기에 적어주세요." @@ -20,12 +29,10 @@ class CheckRegisterView: BaseView { } let photoFrame = UIView() - let photoTitle = UILabel().then{ $0.text = "사진" $0.font = UIFont.pretendard(size: 14, family: .Medium) } - let photoCollectionView = UICollectionView(frame: .zero, collectionViewLayout: .init()).then{ let flowLayout = UICollectionViewFlowLayout() @@ -40,13 +47,12 @@ class CheckRegisterView: BaseView { $0.register(ImageRegisterCollectionViewCell.self, forCellWithReuseIdentifier: ImageRegisterCollectionViewCell.cellIdentifier) } - var infoFrame : UIView! + let infoFrame: BaseView let addTitle = UILabel().then{ $0.text = "추가 설명" $0.font = UIFont.pretendard(size: 14, family: .Medium) } - let addExplainTextView = UITextView().then{ $0.layer.borderColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor $0.layer.borderWidth = 1 @@ -88,13 +94,11 @@ class CheckRegisterView: BaseView { make.height.equalTo(129) make.trailing.equalToSuperview() } - photoTitle.snp.makeConstraints{ make in make.leading.equalToSuperview().offset(36) make.top.equalToSuperview().offset(9) make.height.equalTo(17) } - photoCollectionView.snp.makeConstraints{ make in make.top.equalTo(photoTitle.snp.bottom).offset(19) make.leading.trailing.equalToSuperview() @@ -103,7 +107,7 @@ class CheckRegisterView: BaseView { } infoFrame.snp.makeConstraints{ make in - make.top.equalTo(photoFrame.snp.bottom) + make.top.equalTo(photoFrame.snp.bottom).offset(16) make.leading.trailing.equalToSuperview() make.height.equalTo(166) } @@ -113,7 +117,6 @@ class CheckRegisterView: BaseView { make.top.equalTo(infoFrame.snp.bottom).offset(18) make.height.equalTo(17) } - addExplainTextView.snp.makeConstraints{ make in make.top.equalTo(addTitle.snp.bottom).offset(11) make.leading.equalToSuperview().offset(24) From 457b4d81ed4c0f4da2a671e272e1c498f4ecf1a4 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:37:03 +0900 Subject: [PATCH 15/24] =?UTF-8?q?#172:=20=EC=9E=AC=EC=B9=98=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=ED=99=95=EC=9D=B8=20-=20=EB=82=B4=20=EC=9E=AC?= =?UTF-8?q?=EC=B9=98=20=EC=A0=95=EB=B3=B4=20View=EC=9D=B8=20MyProductInfoS?= =?UTF-8?q?tackView=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterView/CheckRegisterView.swift | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift b/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift index 63566ee1..97765cb0 100644 --- a/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift +++ b/Zatch/Presentation/Views/RegisterView/CheckRegisterView.swift @@ -132,3 +132,82 @@ class CheckRegisterView: BaseView { } } +extension CheckRegisterView{ + + class MyProductDetailView: UIStackView{ + + let endDateFrame = MyProductInfoStackView(title: "유통기한") + let buyDateFrame = MyProductInfoStackView(title: "구매 일자") + let countFrame = MyProductInfoStackView(title: "수량") + let openFrame = MyProductInfoStackView(title: "개봉 상태") + + override init(frame: CGRect) { + super.init(frame: frame) + hierarchy() + style() + } + + required init(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func hierarchy(){ + self.addArrangedSubview(endDateFrame) + self.addArrangedSubview(buyDateFrame) + self.addArrangedSubview(countFrame) + self.addArrangedSubview(openFrame) + } + + private func style(){ + self.axis = .vertical + self.spacing = 8 + self.alignment = .leading + } + } +} + +extension CheckRegisterView.MyProductDetailView{ + + class MyProductInfoStackView: UIStackView{ + + private let titleLabel = UILabel().then{ + $0.setTypoStyleWithSingleLine(typoStyle: .bold12) + $0.textColor = .black85 + } + private let infoLabel = UILabel().then{ + $0.setTypoStyleWithSingleLine(typoStyle: .medium12) + $0.textColor = .black85 + $0.text = "2022/02/03" + } + + init(title: String){ + self.titleLabel.text = title + super.init(frame: .zero) + style() + layout() + } + + required init(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func style(){ + self.spacing = 10 + self.axis = .horizontal + } + + private func layout(){ + self.addArrangedSubview(titleLabel) + self.addArrangedSubview(infoLabel) + + titleLabel.snp.makeConstraints{ + $0.width.equalTo(47) + } + } + + func setInfo(value: String){ + infoLabel.text = value + } + + } +} From af584c433fb2e0e4ca5b04730dd7b9ee8dc9b90d Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 14:37:48 +0900 Subject: [PATCH 16/24] =?UTF-8?q?#172:=20CheckShareRegisterView=20>=20Chec?= =?UTF-8?q?kShareRegisterInfoView=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EA=B8=B0=EC=A1=B4=20=EC=83=81?= =?UTF-8?q?=EC=86=8D=EC=97=90=EC=84=9C=20=EB=8F=85=EB=A6=BD=EC=A0=81?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20UI=20=EA=B5=AC=EC=84=B1=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckShareRegisterInfoView.swift | 52 ++++++++++++++++++ .../RegisterView/CheckShareRegisterView.swift | 55 ------------------- 2 files changed, 52 insertions(+), 55 deletions(-) create mode 100644 Zatch/Presentation/Views/RegisterView/CheckShareRegisterInfoView.swift delete mode 100644 Zatch/Presentation/Views/RegisterView/CheckShareRegisterView.swift diff --git a/Zatch/Presentation/Views/RegisterView/CheckShareRegisterInfoView.swift b/Zatch/Presentation/Views/RegisterView/CheckShareRegisterInfoView.swift new file mode 100644 index 00000000..ab802066 --- /dev/null +++ b/Zatch/Presentation/Views/RegisterView/CheckShareRegisterInfoView.swift @@ -0,0 +1,52 @@ +// +// CheckShareRegisterInfoView.swift +// Zatch +// +// Created by 박지윤 on 2022/09/23. +// + +import UIKit + +class CheckShareRegisterInfoView: BaseView{ + + let tagStackView = UIStackView().then{ + $0.axis = .horizontal + $0.spacing = 4 + } + let shareTag = ZatchComponent.YellowTag(configuration: .height20).then{ + $0.setTitle("나눔") + } + let myProductCategoryTag = ZatchComponent.PurlpleTag(configuration: .height20).then{ + $0.setTitle("생활용품") + } + let myProductNameLabel = UILabel().then{ + $0.text = "맥도날드 해피밀 마이멜로디 장난감" + $0.textColor = .black85 + $0.setTypoStyleWithSingleLine(typoStyle: .medium12) + } + let myProductDetail = CheckRegisterView.MyProductDetailView() + + override func hierarchy() { + self.addSubview(tagStackView) + self.addSubview(myProductNameLabel) + self.addSubview(myProductDetail) + + tagStackView.addArrangedSubview(shareTag) + tagStackView.addArrangedSubview(myProductCategoryTag) + } + + override func layout() { + tagStackView.snp.makeConstraints{ + $0.top.equalToSuperview() + $0.leading.equalToSuperview().offset(37) + } + myProductNameLabel.snp.makeConstraints{ + $0.top.equalTo(tagStackView.snp.bottom).offset(7) + $0.leading.equalToSuperview().offset(36) + } + myProductDetail.snp.makeConstraints{ + $0.top.equalTo(myProductNameLabel.snp.bottom).offset(22) + $0.leading.equalToSuperview().offset(36) + } + } +} diff --git a/Zatch/Presentation/Views/RegisterView/CheckShareRegisterView.swift b/Zatch/Presentation/Views/RegisterView/CheckShareRegisterView.swift deleted file mode 100644 index 7c6f2a67..00000000 --- a/Zatch/Presentation/Views/RegisterView/CheckShareRegisterView.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// CheckShareRegisterView.swift -// Zatch -// -// Created by 박지윤 on 2022/09/23. -// - -import UIKit - -class CheckShareRegisterView: CheckRegisterInfoView { - - override init(frame: CGRect) { - - super.init(frame: .zero) - - wantCategory.text = "나눔" - myProductLabel.textAlignment = .left - - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func setUpView() { - super.setUpView() - - self.addSubview(wantCategory) - } - - override func setUpConstraint(){ - - super.setUpConstraint() - - wantCategory.snp.makeConstraints{ - $0.leading.equalToSuperview().offset(37) - } - - myCategory.snp.makeConstraints{ - $0.leading.equalTo(wantCategory.snp.trailing).offset(4) - } - - myProductLabel.snp.makeConstraints{ - $0.leading.equalToSuperview().offset(36) - } - - myZatchInfoFrame.snp.makeConstraints{ - $0.leading.equalToSuperview().offset(36) - $0.trailing.equalToSuperview() - } - - } - - -} From 0bc10df67680d599c248b2e310b1f96e390c4dff Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 15:56:40 +0900 Subject: [PATCH 17/24] =?UTF-8?q?#172:=20CheckExchangeRegisterInfoView=20?= =?UTF-8?q?=EA=B8=B0=EC=A1=B4=20=EC=83=81=EC=86=8D=20>=20=EB=8F=85?= =?UTF-8?q?=EB=A6=BD=20View=EB=A1=9C=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckExchangeRegisterViewController.swift | 5 +- .../CheckExchangeRegisterInfoView.swift | 188 ++++++++++++++++++ 2 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterInfoView.swift diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift index 8ba6c5ff..23a804ec 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckExchangeRegisterViewController.swift @@ -10,11 +10,12 @@ import UIKit class CheckExchangeRegisterViewController: CheckRegisterViewController { init(){ - super.init(infoView: CheckExchangeRegisterView()) + super.init(infoView: CheckExchangeRegisterInfoView()) } required init?(coder: NSCoder) { - super.init(infoView: CheckExchangeRegisterView()) + super.init(infoView: CheckExchangeRegisterInfoView()) } } + diff --git a/Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterInfoView.swift b/Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterInfoView.swift new file mode 100644 index 00000000..e9a7f2f9 --- /dev/null +++ b/Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterInfoView.swift @@ -0,0 +1,188 @@ +// +// CheckExchangeRegisterInfoView.swift +// Zatch +// +// Created by 박소윤 on 2023/02/11. +// + +import Foundation + +class CheckExchangeRegisterInfoView: BaseView{ + + let exchangeImage = UIImageView().then{ + $0.image = Image.exchange + } + + let wantFrame = UIView() + let firstWantCategoryTag = ZatchComponent.YellowTag(configuration: .height20).then{ + $0.setTitle("생활용품") + } + let firstWantProductNameLabel = UILabel().then{ + $0.text = "맥도날드 해피밀 마이멜로디 장난감" + $0.numberOfLines = 2 + $0.textColor = .black85 + $0.setTypoStyleWithMultiLine(typoStyle: .medium12) + $0.textAlignment = .center + } + let secondThirdStackView = UIStackView().then{ + $0.spacing = 13 + $0.axis = .vertical + } + let secondWantFrame = WantPriorityProductInfoView().then{ + $0.setPriorityTitle(priority: 2) + $0.setCategoryTitle(categoryId: 1) + $0.setProductName("신상 햄스터 말랑이") + } + let thirdWantFrame = WantPriorityProductInfoView().then{ + $0.setPriorityTitle(priority: 3) + $0.setCategoryTitle(categoryId: 1) + $0.setProductName("신상 햄스터 고양이 강아지 모양 말랑이") + } + + let myFrame = UIView() + let myProductCategoryTag = ZatchComponent.PurlpleTag(configuration: .height20).then{ + $0.setTitle("생활용품") + } + let myProductNameLabel = UILabel().then{ + $0.text = "장난감" + $0.numberOfLines = 2 + $0.textColor = .black85 + $0.setTypoStyleWithMultiLine(typoStyle: .medium12) + $0.textAlignment = .center + } + let myProductDetail = CheckRegisterView.MyProductDetailView() + + + override func hierarchy(){ + + self.addSubview(wantFrame) + self.addSubview(exchangeImage) + self.addSubview(myFrame) + + wantFrame.addSubview(firstWantCategoryTag) + wantFrame.addSubview(firstWantProductNameLabel) + wantFrame.addSubview(secondThirdStackView) + + secondThirdStackView.addArrangedSubview(secondWantFrame) + secondThirdStackView.addArrangedSubview(thirdWantFrame) + + myFrame.addSubview(myProductCategoryTag) + myFrame.addSubview(myProductNameLabel) + myFrame.addSubview(myProductDetail) + + } + + override func layout(){ + + exchangeImage.snp.makeConstraints{ + $0.top.equalToSuperview().offset(7) + $0.centerX.equalToSuperview() + $0.width.height.equalTo(24) + } + + wantFrame.snp.makeConstraints{ + $0.top.equalToSuperview() + $0.leading.equalToSuperview().offset(23) + $0.trailing.equalTo(exchangeImage.snp.leading) + } + firstWantCategoryTag.snp.makeConstraints{ + $0.centerX.equalToSuperview() + } + firstWantProductNameLabel.snp.makeConstraints{ + $0.top.equalTo(firstWantCategoryTag.snp.bottom).offset(5) + $0.leading.equalToSuperview().offset(12) + $0.trailing.equalToSuperview().offset(-20) + $0.height.equalTo(32) + } + secondThirdStackView.snp.makeConstraints{ + $0.top.equalTo(firstWantProductNameLabel.snp.bottom).offset(11) + $0.leading.equalToSuperview() + $0.trailing.equalToSuperview().offset(-4) + } + + myFrame.snp.makeConstraints{ + $0.top.equalToSuperview() + $0.trailing.equalToSuperview().offset(-24) + $0.leading.equalTo(exchangeImage.snp.trailing).offset(20) + } + myProductCategoryTag.snp.makeConstraints{ + $0.top.equalToSuperview() + $0.centerX.equalTo(myProductNameLabel) + } + myProductNameLabel.snp.makeConstraints{ + $0.top.equalTo(myProductCategoryTag.snp.bottom).offset(5) + $0.leading.equalToSuperview() + $0.trailing.equalToSuperview().offset(-11) + $0.height.equalTo(32) + } + myProductDetail.snp.makeConstraints{ + $0.top.equalTo(myProductNameLabel.snp.bottom).offset(11) + $0.leading.equalToSuperview() + } + } +} + + + +extension CheckExchangeRegisterInfoView{ + + class WantPriorityProductInfoView: BaseView{ + + private let priorityLabel = UILabel().then{ + $0.setTypoStyleWithSingleLine(typoStyle: .bold12) + $0.textColor = .zatchDeepYellow + $0.textAlignment = .center + } + + private let productLabel = UILabel().then{ + $0.numberOfLines = 2 + $0.setTypoStyleWithMultiLine(typoStyle: .medium12) + $0.textColor = .black85 + $0.textAlignment = .left + } + + private let categoryLabel = UILabel().then{ + $0.textColor = .black20 + $0.setTypoStyleWithSingleLine(typoStyle: .medium10) + } + + override func hierarchy() { + self.addSubview(priorityLabel) + self.addSubview(productLabel) + self.addSubview(categoryLabel) + } + + override func layout() { + priorityLabel.snp.makeConstraints{ + $0.height.equalTo(17) + $0.width.equalTo(39) + $0.leading.top.equalToSuperview() + } + categoryLabel.snp.makeConstraints{ + $0.top.equalTo(priorityLabel.snp.bottom) + $0.leading.equalToSuperview().offset(4) + $0.height.equalTo(13) + $0.width.equalTo(39) + $0.bottom.equalToSuperview().offset(-2) + } + productLabel.snp.makeConstraints{ + $0.top.trailing.equalToSuperview() + $0.leading.equalTo(priorityLabel.snp.trailing).offset(9) + } + } + + func setPriorityTitle(priority: Int){ + priorityLabel.text = "\(priority)순위" + } + + func setCategoryTitle(categoryId: Int){ + let category = ServiceType.Zatch.getCategoryFromCategories(at: categoryId).title + categoryLabel.text = category + } + + func setProductName(_ name: String){ + productLabel.text = name + } + } + +} From 4db5b2c36765e344f63a38620223034cc0fef43c Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 15:57:07 +0900 Subject: [PATCH 18/24] =?UTF-8?q?#172:=20CheckExchangeRegisterView=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckExchangeRegisterView.swift | 197 ------------------ 1 file changed, 197 deletions(-) delete mode 100644 Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterView.swift diff --git a/Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterView.swift b/Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterView.swift deleted file mode 100644 index 223aa741..00000000 --- a/Zatch/Presentation/Views/RegisterView/CheckExchangeRegisterView.swift +++ /dev/null @@ -1,197 +0,0 @@ -// -// CheckExchangeRegisterView.swift -// Zatch -// -// Created by 박지윤 on 2022/09/23. -// - -import UIKit - -class CheckExchangeRegisterView: CheckRegisterInfoView { - - let exchangeImage = UIImageView().then{ - $0.image = Image.exchange - } - - //want - let myFrame = UIView() - let wantFrame = UIView() - - let firstWantProduct = UILabel().then{ - $0.text = "맥도날드 해피밀 마이멜로디 장난감" - $0.font = UIFont.pretendard(size: 12, family: .Medium) - $0.numberOfLines = 2 - $0.textAlignment = .center - } - - let secondWantFrame = WantProductInfoView().then{ - $0.rankLabel.text = "2순위" - $0.categoryLabel.text = "생활용품" - $0.productLabel.text = "신상 햄스터 말랑이" - } - - let thirdWantFrame = WantProductInfoView().then{ - $0.rankLabel.text = "3순위" - $0.categoryLabel.text = "생활용품" - $0.productLabel.text = "신상 햄스터 고양이 강아지 모양 말랑이" - } - - let secondThirdStackView = UIStackView().then{ - $0.spacing = 13 - $0.axis = .vertical - } - - override init(frame: CGRect) { - - super.init(frame: .zero) - - myProductLabel.textAlignment = .center - - setUpView() - setUpConstraint() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func setUpView(){ - - super.setUpView() - - self.addSubview(wantFrame) - self.addSubview(exchangeImage) - self.addSubview(myFrame) - - wantFrame.addSubview(wantCategory) - wantFrame.addSubview(firstWantProduct) - wantFrame.addSubview(secondThirdStackView) - - secondThirdStackView.addArrangedSubview(secondWantFrame) - secondThirdStackView.addArrangedSubview(thirdWantFrame) - - myFrame.addSubview(myCategory) - myFrame.addSubview(myProductLabel) - myFrame.addSubview(myZatchInfoFrame) - - } - - override func setUpConstraint(){ - - super.setUpConstraint() - - exchangeImage.snp.makeConstraints{ make in - make.top.equalToSuperview().offset(23) - make.centerX.equalToSuperview() - make.width.height.equalTo(24) - } - - wantFrame.snp.makeConstraints{ make in - make.leading.equalToSuperview().offset(23) - make.trailing.equalTo(exchangeImage.snp.leading) - } - - wantCategory.snp.makeConstraints{ make in - make.centerX.equalToSuperview() - } - - firstWantProduct.snp.makeConstraints{ make in - make.top.equalTo(wantCategory.snp.bottom).offset(5) - make.leading.equalToSuperview().offset(12) - make.trailing.equalToSuperview().offset(-20) - make.height.equalTo(32) - } - - secondThirdStackView.snp.makeConstraints{ make in - make.top.equalTo(firstWantProduct.snp.bottom).offset(11) - make.leading.equalToSuperview() - make.trailing.equalToSuperview().offset(-4) - } - - // - myFrame.snp.makeConstraints{ make in - make.top.bottom.equalToSuperview() - make.trailing.equalToSuperview().offset(-24) - make.leading.equalTo(exchangeImage.snp.trailing).offset(20) - } - - myCategory.snp.makeConstraints{ make in - make.centerX.equalTo(myProductLabel) - } - - myProductLabel.snp.makeConstraints{ make in - make.leading.equalToSuperview() - make.trailing.equalToSuperview().offset(-11) - } - - myZatchInfoFrame.snp.makeConstraints{ make in - make.leading.trailing.equalToSuperview() - } - - } - -} - -extension CheckExchangeRegisterView{ - - class WantProductInfoView: UIView{ - - let rankLabel = UILabel().then{ - $0.font = UIFont.pretendard(size: 12, family: .Bold) - $0.textColor = .zatchDeepYellow - $0.textAlignment = .center - } - - let productLabel = UILabel().then{ - $0.numberOfLines = 2 - $0.font = UIFont.pretendard(size: 12, family: .Medium) - $0.textColor = .black85 - $0.textAlignment = .left - } - - let categoryLabel = UILabel().then{ - $0.textColor = .black20 - $0.font = UIFont.pretendard(size: 10, family: .Medium) - } - - override init(frame: CGRect) { - super.init(frame: .zero) - - setUpView() - setUpConstraint() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func setUpView(){ - self.addSubview(rankLabel) - self.addSubview(productLabel) - self.addSubview(categoryLabel) - } - - func setUpConstraint(){ - - rankLabel.snp.makeConstraints{ - $0.height.equalTo(17) - $0.width.equalTo(39) - $0.leading.top.equalToSuperview() - } - - categoryLabel.snp.makeConstraints{ - $0.top.equalTo(rankLabel.snp.bottom) - $0.leading.equalToSuperview().offset(4) - $0.height.equalTo(13) - $0.width.equalTo(39) - $0.bottom.equalToSuperview().offset(-2) - } - - productLabel.snp.makeConstraints{ - $0.top.trailing.equalToSuperview() - $0.leading.equalTo(rankLabel.snp.trailing).offset(9) - } - } - } - -} From 5be74dba51507df0a811bfa7dc03db0af08749c3 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 15:57:26 +0900 Subject: [PATCH 19/24] =?UTF-8?q?#172:=20CheckRegisterInfoView=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterView/CheckRegisterInfoView.swift | 165 ------------------ 1 file changed, 165 deletions(-) delete mode 100644 Zatch/Presentation/Views/RegisterView/CheckRegisterInfoView.swift diff --git a/Zatch/Presentation/Views/RegisterView/CheckRegisterInfoView.swift b/Zatch/Presentation/Views/RegisterView/CheckRegisterInfoView.swift deleted file mode 100644 index e26caca5..00000000 --- a/Zatch/Presentation/Views/RegisterView/CheckRegisterInfoView.swift +++ /dev/null @@ -1,165 +0,0 @@ -// -// CheckRegisterZatchInfoView.swift -// Zatch -// -// Created by 박지윤 on 2022/08/11. -// - -import UIKit - -class CheckRegisterInfoView: UIView { - - let wantCategory = PaddingLabel().then{ - $0.text = "생활용품" - $0.font = UIFont.pretendard(size: 12, family: .Medium) - $0.textColor = .zatchDeepYellow - $0.backgroundColor = .yellow40 - $0.clipsToBounds = true - $0.layer.cornerRadius = 20/2 - } - - let myCategory = PaddingLabel().then{ - $0.text = "생활용품" - $0.font = UIFont.pretendard(size: 12, family: .Medium) - $0.textColor = .zatchPurple - $0.backgroundColor = .purple40 - $0.clipsToBounds = true - $0.layer.cornerRadius = 20/2 - } - - let myProductLabel = UILabel().then{ - $0.text = "헤드셋" - $0.font = UIFont.pretendard(size: 12, family: .Medium) - $0.numberOfLines = 2 - } - - let myZatchInfoFrame = UIView() - - let endDateFrame = MyProductStackView().then{ - $0.titleLabel.text = "유통기한" - $0.infoLabel.text = "2021/01/28" - } - - let buyDateFrame = MyProductStackView().then{ - $0.titleLabel.text = "구매일자" - $0.infoLabel.text = "2021/01/28" - } - - let countFrame = MyProductStackView().then{ - $0.titleLabel.text = "수량" - $0.infoLabel.text = "2개" - } - - let isOpenFrame = MyProductStackView().then{ - $0.titleLabel.text = "개봉상태" - $0.infoLabel.text = "개봉" - } - - override init(frame: CGRect) { - super.init(frame: .zero) - - setUpView() - setUpConstraint() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func setUpView(){ - - self.addSubview(myCategory) - self.addSubview(myProductLabel) - self.addSubview(myZatchInfoFrame) - - myZatchInfoFrame.addSubview(endDateFrame) - myZatchInfoFrame.addSubview(buyDateFrame) - myZatchInfoFrame.addSubview(countFrame) - myZatchInfoFrame.addSubview(isOpenFrame) - - } - - func setUpConstraint(){ - - myCategory.snp.makeConstraints{ make in - make.top.equalToSuperview().offset(16) - make.height.equalTo(20) - } - - wantCategory.snp.makeConstraints{ - $0.top.equalToSuperview().offset(16) - $0.height.equalTo(20) - } - - myProductLabel.snp.makeConstraints{ make in - make.top.equalTo(myCategory.snp.bottom).offset(5) - make.height.equalTo(32) - } - - - myZatchInfoFrame.snp.makeConstraints{ make in - make.top.equalTo(myProductLabel.snp.bottom).offset(7) - make.bottom.equalToSuperview() - } - - endDateFrame.snp.makeConstraints{ make in - make.top.leading.equalToSuperview() - make.trailing.equalToSuperview() - } - - buyDateFrame.snp.makeConstraints{ make in - make.leading.equalToSuperview() - make.top.equalTo(endDateFrame.snp.bottom).offset(6) - make.trailing.equalToSuperview() - } - - countFrame.snp.makeConstraints{ make in - make.leading.equalToSuperview() - make.top.equalTo(buyDateFrame.snp.bottom).offset(8) - make.trailing.equalToSuperview() - } - - isOpenFrame.snp.makeConstraints{ make in - make.leading.equalToSuperview() - make.top.equalTo(countFrame.snp.bottom).offset(4) - make.trailing.equalToSuperview() - } - - } -} - -extension CheckRegisterInfoView{ - - class MyProductStackView: UIStackView{ - - let titleLabel = UILabel().then{ - $0.font = UIFont.pretendard(size: 12, family: .Bold) - $0.textColor = .black85 - } - - let infoLabel = UILabel().then{ - $0.font = UIFont.pretendard(size: 12, family: .Medium) - $0.textColor = .black85 - } - - override init(frame: CGRect){ - - super.init(frame: .zero) - - self.spacing = 10 - self.axis = .horizontal - - self.addArrangedSubview(titleLabel) - self.addArrangedSubview(infoLabel) - - titleLabel.snp.makeConstraints{ - $0.width.equalTo(47) - } - } - - required init(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - } -} From 0febf276d16d9d6ef7a21a0132d6717516ead941 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 15:58:08 +0900 Subject: [PATCH 20/24] =?UTF-8?q?#172:=20ZatchRegisterFirstVC=20TextFieldT?= =?UTF-8?q?abeViewCell=20informationType=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch.xcodeproj/project.pbxproj | 20 +++---- .../Zatch/CheckRegisterViewController.swift | 4 +- .../CheckShareRegisterViewController.swift | 4 +- .../ZatchRegisterFirstViewController.swift | 1 + .../ZatchRegisterSecondViewController.swift | 5 +- .../Storyboard/Base.lproj/Main.storyboard | 54 +++++++++---------- 6 files changed, 43 insertions(+), 45 deletions(-) diff --git a/Zatch.xcodeproj/project.pbxproj b/Zatch.xcodeproj/project.pbxproj index 3f49318c..e9d16c0a 100644 --- a/Zatch.xcodeproj/project.pbxproj +++ b/Zatch.xcodeproj/project.pbxproj @@ -179,7 +179,6 @@ 576EA927282B7FD60028046C /* CheckRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576EA926282B7FD60028046C /* CheckRegisterViewController.swift */; }; 57713944281F596C0066DEEB /* TitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57713943281F596C0066DEEB /* TitleView.swift */; }; 577A01B628A496D1004B2575 /* UITextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577A01B528A496D1004B2575 /* UITextView.swift */; }; - 577A01B828A49C97004B2575 /* CheckRegisterInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577A01B728A49C97004B2575 /* CheckRegisterInfoView.swift */; }; 578B7A9828AC6AF900E7B4F4 /* ChattingRoomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 578B7A9728AC6AF900E7B4F4 /* ChattingRoomViewController.swift */; }; 578B7A9C28AC892800E7B4F4 /* ChatInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 578B7A9B28AC892800E7B4F4 /* ChatInputView.swift */; }; 5795770428BB1AB400237A12 /* MemberDeclarationSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5795770328BB1AB400237A12 /* MemberDeclarationSheetViewController.swift */; }; @@ -277,8 +276,7 @@ 57F68BAA29652ED300DB1471 /* DetailEtcBottomSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57F68BA929652ED300DB1471 /* DetailEtcBottomSheetView.swift */; }; 57FEFA8C297A70F5008A78B0 /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FEFA8B297A70F5008A78B0 /* UICollectionView.swift */; }; 57FFEDBF28DD27FE0041719B /* CheckRegisterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FFEDBE28DD27FE0041719B /* CheckRegisterView.swift */; }; - 57FFEDC128DD28090041719B /* CheckShareRegisterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FFEDC028DD28090041719B /* CheckShareRegisterView.swift */; }; - 57FFEDC328DD281F0041719B /* CheckExchangeRegisterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FFEDC228DD281F0041719B /* CheckExchangeRegisterView.swift */; }; + 57FFEDC128DD28090041719B /* CheckShareRegisterInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FFEDC028DD28090041719B /* CheckShareRegisterInfoView.swift */; }; 57FFEDC528DD2F0D0041719B /* CheckShareRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FFEDC428DD2F0D0041719B /* CheckShareRegisterViewController.swift */; }; 57FFEDC728DD2F1B0041719B /* CheckExchangeRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57FFEDC628DD2F1B0041719B /* CheckExchangeRegisterViewController.swift */; }; 6AF93CFE86982B0FFAF29206 /* Pods_Zatch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99A9FAD0C12F2252FE5C8E69 /* Pods_Zatch.framework */; }; @@ -317,6 +315,7 @@ EEE6D15829973C1C0004FC7B /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15729973C1C0004FC7B /* Tag.swift */; }; EEE6D15B299752EB0004FC7B /* TagStlye.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15A299752EB0004FC7B /* TagStlye.swift */; }; EEE6D15E299757EF0004FC7B /* Padding.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15D299757EF0004FC7B /* Padding.swift */; }; + EEE6D160299762670004FC7B /* CheckExchangeRegisterInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE6D15F299762670004FC7B /* CheckExchangeRegisterInfoView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -519,7 +518,6 @@ 576EA926282B7FD60028046C /* CheckRegisterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckRegisterViewController.swift; sourceTree = ""; }; 57713943281F596C0066DEEB /* TitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleView.swift; sourceTree = ""; }; 577A01B528A496D1004B2575 /* UITextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextView.swift; sourceTree = ""; }; - 577A01B728A49C97004B2575 /* CheckRegisterInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckRegisterInfoView.swift; sourceTree = ""; }; 578B7A9728AC6AF900E7B4F4 /* ChattingRoomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChattingRoomViewController.swift; sourceTree = ""; }; 578B7A9B28AC892800E7B4F4 /* ChatInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatInputView.swift; sourceTree = ""; }; 5795770328BB1AB400237A12 /* MemberDeclarationSheetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberDeclarationSheetViewController.swift; sourceTree = ""; }; @@ -627,8 +625,7 @@ 57FEFA8A297A5E48008A78B0 /* UISheetPresentationControllerDetent+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UISheetPresentationControllerDetent+Private.h"; sourceTree = ""; }; 57FEFA8B297A70F5008A78B0 /* UICollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UICollectionView.swift; sourceTree = ""; }; 57FFEDBE28DD27FE0041719B /* CheckRegisterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckRegisterView.swift; sourceTree = ""; }; - 57FFEDC028DD28090041719B /* CheckShareRegisterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckShareRegisterView.swift; sourceTree = ""; }; - 57FFEDC228DD281F0041719B /* CheckExchangeRegisterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckExchangeRegisterView.swift; sourceTree = ""; }; + 57FFEDC028DD28090041719B /* CheckShareRegisterInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckShareRegisterInfoView.swift; sourceTree = ""; }; 57FFEDC428DD2F0D0041719B /* CheckShareRegisterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckShareRegisterViewController.swift; sourceTree = ""; }; 57FFEDC628DD2F1B0041719B /* CheckExchangeRegisterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckExchangeRegisterViewController.swift; sourceTree = ""; }; 6E2CF233E53955D92629E42D /* Pods-Zatch-ZatchUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Zatch-ZatchUITests.release.xcconfig"; path = "Target Support Files/Pods-Zatch-ZatchUITests/Pods-Zatch-ZatchUITests.release.xcconfig"; sourceTree = ""; }; @@ -668,6 +665,7 @@ EEE6D15729973C1C0004FC7B /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; EEE6D15A299752EB0004FC7B /* TagStlye.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagStlye.swift; sourceTree = ""; }; EEE6D15D299757EF0004FC7B /* Padding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Padding.swift; sourceTree = ""; }; + EEE6D15F299762670004FC7B /* CheckExchangeRegisterInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckExchangeRegisterInfoView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1909,9 +1907,8 @@ 57B32C2B291F49CF0018C0CB /* ZatchRegisterFirstView.swift */, 57B32C2D291F49DC0018C0CB /* ZatchRegisterSecondView.swift */, 57FFEDBE28DD27FE0041719B /* CheckRegisterView.swift */, - 577A01B728A49C97004B2575 /* CheckRegisterInfoView.swift */, - 57FFEDC028DD28090041719B /* CheckShareRegisterView.swift */, - 57FFEDC228DD281F0041719B /* CheckExchangeRegisterView.swift */, + 57FFEDC028DD28090041719B /* CheckShareRegisterInfoView.swift */, + EEE6D15F299762670004FC7B /* CheckExchangeRegisterInfoView.swift */, EE410196298557440083B7E0 /* ImageDetailView.swift */, ); path = RegisterView; @@ -2389,12 +2386,12 @@ 235613F328D0974A00D44E97 /* ProfileViewController.swift in Sources */, EE73C51E299610F80000F8AC /* ProductQuantityTableViewCell.swift in Sources */, 5722461628C2F827009B7C78 /* AlertViewController.swift in Sources */, - 57FFEDC328DD281F0041719B /* CheckExchangeRegisterView.swift in Sources */, 57468A85289EB32000056691 /* FindSearchTagCollectionViewCell.swift in Sources */, EE2BC3512982B881002B5C60 /* MainHeaderView.swift in Sources */, 57D6D79728CDBC5000F805B7 /* MakeMeetingSheetView.swift in Sources */, 577A01B628A496D1004B2575 /* UITextView.swift in Sources */, 23E764D428E9EF89002F234C /* TradeViewController.swift in Sources */, + EEE6D160299762670004FC7B /* CheckExchangeRegisterInfoView.swift in Sources */, 23A57920296547AC004F08DE /* ChattingListTabManViewController.swift in Sources */, 576B375B28D82E9A00EF36E6 /* SettingViewController.swift in Sources */, 571C0C6C28AB151A002293B6 /* ChattingListViewController.swift in Sources */, @@ -2456,7 +2453,7 @@ 57E75EC528E3C4CE00AC24B2 /* ShareDetailTableViewCell.swift in Sources */, 576B376A28D846CB00EF36E6 /* SettingBorderLineTableViewCell.swift in Sources */, EE9B053529953A1200068503 /* FilterView.swift in Sources */, - 57FFEDC128DD28090041719B /* CheckShareRegisterView.swift in Sources */, + 57FFEDC128DD28090041719B /* CheckShareRegisterInfoView.swift in Sources */, 23A86A5928C7321C00B073CB /* MainBannerTableViewCell.swift in Sources */, 571DADC2297BA41B0079CCD3 /* BaseHeaderView.swift in Sources */, 57EBCE4228A8C67B00212D20 /* DatePickerAlertViewController.swift in Sources */, @@ -2543,7 +2540,6 @@ 57E75ECB28E5482900AC24B2 /* ResultSearchView.swift in Sources */, EE73C51A2995FB170000F8AC /* ProductDateChoiceTableViewCell.swift in Sources */, 576B375428D6D82200EF36E6 /* MapMeetingViewController.swift in Sources */, - 577A01B828A49C97004B2575 /* CheckRegisterInfoView.swift in Sources */, 57EBCE3B28A87BFD00212D20 /* ImageAddBtnCollectionViewCell.swift in Sources */, 57468A8B289FEB2000056691 /* BaseBottomSheetViewController.swift in Sources */, 576341C628D40A3A0067D2C5 /* MeetingMapAlertViewController.swift in Sources */, diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckRegisterViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckRegisterViewController.swift index a3840b18..b0c31e66 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/CheckRegisterViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/CheckRegisterViewController.swift @@ -11,9 +11,9 @@ class CheckRegisterViewController: BaseViewController - + @@ -9,39 +9,21 @@ - - + + - - + + - + - + - + - - - - - - - - - - - - - - - - - - - + @@ -57,6 +39,24 @@ + + + + + + + + + + + + + + + + + + From bb900ba0cadba90ccfc63cdfb7e09a002ed92c86 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 16:10:35 +0900 Subject: [PATCH 21/24] =?UTF-8?q?#171:=20Tag=20disabled=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=B6=94=EA=B0=80=20>=20=ED=9A=8C=EC=83=89?= =?UTF-8?q?=EC=9D=98=20=EC=84=A0=ED=83=9DX=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=ED=91=9C=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch/Global/Source/Component/Tag/Tag.swift | 10 ++++++++++ .../Global/Source/Component/Tag/TagStlye.swift | 18 ++++++++++++++++-- .../Storyboard/Base.lproj/Main.storyboard | 8 ++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Zatch/Global/Source/Component/Tag/Tag.swift b/Zatch/Global/Source/Component/Tag/Tag.swift index f4bad6c1..b138509e 100644 --- a/Zatch/Global/Source/Component/Tag/Tag.swift +++ b/Zatch/Global/Source/Component/Tag/Tag.swift @@ -33,6 +33,11 @@ extension ZatchComponent{ class Tag: UILabel{ + var isDisabled = false{ + didSet{ + isDisabled ? setDisabledState() : setNormalState() + } + } var isSelected = false{ didSet{ isSelected ? setSelectState() : setNormalState() @@ -89,6 +94,11 @@ extension ZatchComponent{ self.backgroundColor = colorType.backgroundColor } + private func setDisabledState(){ + self.textColor = colorType.disabledTextColor + self.backgroundColor = colorType.disabledBackgroundColor + } + private func setSelectState(){ self.textColor = colorType.selectedTextColor self.backgroundColor = colorType.selectedBackgroundColor diff --git a/Zatch/Global/Source/Component/Tag/TagStlye.swift b/Zatch/Global/Source/Component/Tag/TagStlye.swift index 28f5fd59..e2dfc8eb 100644 --- a/Zatch/Global/Source/Component/Tag/TagStlye.swift +++ b/Zatch/Global/Source/Component/Tag/TagStlye.swift @@ -26,6 +26,8 @@ extension ZatchComponent.Tag.TagColor{ let backgroundColor: UIColor let selectedTextColor: UIColor = .white let selectedBackgroundColor: UIColor + let disabledTextColor: UIColor + let disabledBackgroundColor: UIColor } private var colorInfo: TagColorStyle{ @@ -33,11 +35,15 @@ extension ZatchComponent.Tag.TagColor{ case .purple: return TagColorStyle(textColor: .zatchPurple, backgroundColor: .purple40, - selectedBackgroundColor: .zatchPurple) + selectedBackgroundColor: .zatchPurple, + disabledTextColor: .black20, + disabledBackgroundColor: .black10) case .yellow: return TagColorStyle(textColor: .zatchDeepYellow, backgroundColor: .yellow40, - selectedBackgroundColor: .zatchDeepYellow) + selectedBackgroundColor: .zatchDeepYellow, + disabledTextColor: .black20, + disabledBackgroundColor: .black10) } } @@ -56,6 +62,14 @@ extension ZatchComponent.Tag.TagColor{ var selectedBackgroundColor: UIColor{ colorInfo.selectedBackgroundColor } + + var disabledTextColor: UIColor{ + colorInfo.disabledTextColor + } + + var disabledBackgroundColor: UIColor{ + colorInfo.disabledBackgroundColor + } } extension ZatchComponent.Tag.TagType{ diff --git a/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard b/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard index ef82bead..a7152c02 100644 --- a/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard +++ b/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - + @@ -9,10 +9,10 @@ - + - + @@ -37,7 +37,7 @@ - + From b63f26f22daa2baeb7d97fa2e2dedeb7821bf909 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 16:53:12 +0900 Subject: [PATCH 22/24] =?UTF-8?q?#171:=20Tag=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=EB=A1=9C=20=ED=83=80=EC=9D=B4=ED=8B=80=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch/Global/Source/Component/Tag/Tag.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Zatch/Global/Source/Component/Tag/Tag.swift b/Zatch/Global/Source/Component/Tag/Tag.swift index b138509e..aa5cae21 100644 --- a/Zatch/Global/Source/Component/Tag/Tag.swift +++ b/Zatch/Global/Source/Component/Tag/Tag.swift @@ -90,16 +90,19 @@ extension ZatchComponent{ } private func setNormalState(){ + self.tag = ViewTag.normal self.textColor = colorType.textColor self.backgroundColor = colorType.backgroundColor } private func setDisabledState(){ + self.tag = ViewTag.deselect self.textColor = colorType.disabledTextColor self.backgroundColor = colorType.disabledBackgroundColor } private func setSelectState(){ + self.tag = ViewTag.select self.textColor = colorType.selectedTextColor self.backgroundColor = colorType.selectedBackgroundColor } @@ -107,5 +110,10 @@ extension ZatchComponent{ func setTitle(_ title: String){ self.text = title } + + func setCategoryTitle(categoryId: Int){ + let category = ServiceType.Zatch.getCategoryFromCategories(at: categoryId) + self.text = category.title + } } } From 07d844adeb6ce98918d28146edfa1bacb70120f2 Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Sat, 11 Feb 2023 16:54:25 +0900 Subject: [PATCH 23/24] =?UTF-8?q?refactor:=20ViewTag=20=EA=B5=AC=EC=A1=B0?= =?UTF-8?q?=EC=B2=B4=20Const=20=EB=B0=96=EC=9C=BC=EB=A1=9C=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zatch/Global/Source/Component/RadioButtonView.swift | 2 +- Zatch/Global/Source/Const.swift | 11 ++++++----- .../Zatch/ZatchRegisterSecondViewController.swift | 2 +- .../RegisterView/CheckExchangeRegisterInfoView.swift | 2 +- .../RegisterView/CheckShareRegisterInfoView.swift | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Zatch/Global/Source/Component/RadioButtonView.swift b/Zatch/Global/Source/Component/RadioButtonView.swift index 33d5e810..5ca40706 100644 --- a/Zatch/Global/Source/Component/RadioButtonView.swift +++ b/Zatch/Global/Source/Component/RadioButtonView.swift @@ -14,7 +14,7 @@ extension ZatchComponent{ var isSelected = false{ didSet{ radioButton.isSelected = isSelected - self.tag = isSelected ? Const.ViewTag.select : Const.ViewTag.unselect + self.tag = isSelected ? ViewTag.select : ViewTag.normal } } diff --git a/Zatch/Global/Source/Const.swift b/Zatch/Global/Source/Const.swift index bb58d420..5b9c0e8e 100644 --- a/Zatch/Global/Source/Const.swift +++ b/Zatch/Global/Source/Const.swift @@ -23,9 +23,10 @@ struct Const{ static let TOP_OFFSET = 107 //navigationView 고려한 top offset static let headerTop = 47 } - - struct ViewTag{ - static let select = 1 - static let unselect = 0 - } +} + +struct ViewTag{ + static let normal = 1 + static let select = 2 + static let deselect = 3 } diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift index 436c557f..815daace 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterSecondViewController.swift @@ -99,7 +99,7 @@ class ZatchRegisterSecondViewController: BaseViewController Date: Sat, 11 Feb 2023 16:55:14 +0900 Subject: [PATCH 24/24] =?UTF-8?q?#172:=20=EC=9E=AC=EC=B9=98=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=B2=AB=EB=B2=88=EC=A7=B8=20VC=20=EA=B0=9C?= =?UTF-8?q?=EB=B4=89=20=EC=97=AC=EB=B6=80=20Cell=20>=20Tag=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20?= =?UTF-8?q?Rx=20=ED=86=B5=ED=95=9C=20manager=EC=97=90=20=EA=B0=92=20?= =?UTF-8?q?=EB=B0=94=EC=9D=B8=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductIsOpenTableViewCell.swift | 89 +++++++++---------- .../ZatchRegisterFirstViewController.swift | 6 -- 2 files changed, 42 insertions(+), 53 deletions(-) diff --git a/Zatch/Presentation/Cells/RegisterCells/DetailInput/ProductIsOpenTableViewCell.swift b/Zatch/Presentation/Cells/RegisterCells/DetailInput/ProductIsOpenTableViewCell.swift index 3c814092..799f1cbe 100644 --- a/Zatch/Presentation/Cells/RegisterCells/DetailInput/ProductIsOpenTableViewCell.swift +++ b/Zatch/Presentation/Cells/RegisterCells/DetailInput/ProductIsOpenTableViewCell.swift @@ -6,43 +6,34 @@ // import Foundation +import RxSwift -class ProductIsOpenTableViewCell: BaseTableViewCell { +class ProductIsOpenTableViewCell: BaseTableViewCell, DefaultObservable { + + let disposeBag = DisposeBag() + let registerManager = ZatchRegisterRequestManager.shared let titleLabel = UILabel().then{ $0.text = "개봉상태" $0.textColor = .black $0.font = UIFont.pretendard(size: 14, family: .Medium) } - - var radioButtonArray : [ZatchTextRadioButton]! - - let unOpenRadioButton = ZatchTextRadioButton().then{ - $0.setTitle("미개봉", for: .normal) - $0.isSelected = true - $0.addTarget(self, action: #selector(radioButtonSelectListener(_:)), for: .touchUpInside) - } - - let openRadioButton = ZatchTextRadioButton().then{ - $0.setTitle("개봉", for: .normal) - $0.addTarget(self, action: #selector(radioButtonSelectListener(_:)), for: .touchUpInside) - } - - let stackView = UIStackView().then{ + let tagStackView = UIStackView().then{ $0.spacing = 8 $0.axis = .horizontal } + let unOpenRadioButton = ZatchComponent.PurlpleTag(configuration: .height20).then{ + $0.setTitle("미개봉") + } + let openRadioButton = ZatchComponent.PurlpleTag(configuration: .height20).then{ + $0.setTitle("개봉") + $0.isDisabled = true + } - var currentSelect : ZatchTextRadioButton! - override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) - - currentSelect = unOpenRadioButton - + bind() } - required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -51,14 +42,15 @@ class ProductIsOpenTableViewCell: BaseTableViewCell { super.hierarchy() baseView.addSubview(titleLabel) - baseView.addSubview(stackView) + baseView.addSubview(tagStackView) - stackView.addArrangedSubview(unOpenRadioButton) - stackView.addArrangedSubview(openRadioButton) + tagStackView.addArrangedSubview(unOpenRadioButton) + tagStackView.addArrangedSubview(openRadioButton) } override func layout() { + super.layout() baseView.snp.updateConstraints{ @@ -67,7 +59,6 @@ class ProductIsOpenTableViewCell: BaseTableViewCell { baseView.snp.makeConstraints{ $0.height.equalTo(37) - $0.leading.trailing.bottom.equalToSuperview() } titleLabel.snp.makeConstraints{ make in @@ -75,30 +66,34 @@ class ProductIsOpenTableViewCell: BaseTableViewCell { make.centerY.equalToSuperview() } - stackView.snp.makeConstraints{ make in + tagStackView.snp.makeConstraints{ make in make.centerY.equalToSuperview() - make.leading.equalTo(titleLabel.snp.trailing).offset(12) - make.width.equalTo(100) - make.height.equalTo(20) - } - - unOpenRadioButton.snp.makeConstraints{ make in - make.width.equalTo(48) - make.height.equalTo(20) + make.leading.equalTo(titleLabel.snp.trailing).offset(20) } + } + + func bind() { + unOpenRadioButton.rx.tapGesture() + .when(.recognized) + .bind(onNext: { [weak self] in + self?.registerManager.isOpen = false + self?.changeTagState(recognizer: $0) + }).disposed(by: disposeBag) - openRadioButton.snp.makeConstraints{ make in - make.width.equalTo(37) - make.height.equalTo(20) - } + openRadioButton.rx.tapGesture() + .when(.recognized) + .bind(onNext: { [weak self] in + self?.registerManager.isOpen = true + self?.changeTagState(recognizer: $0) + }).disposed(by: disposeBag) } - @objc func radioButtonSelectListener(_ sender: ZatchTextRadioButton){ - if(currentSelect != sender){ - currentSelect.isSelected = false - sender.isSelected = true - currentSelect = sender - } + private func changeTagState(recognizer: UITapGestureRecognizer){ + + guard let selectTag = recognizer.view as? ZatchComponent.PurlpleTag, + let willDisabledTag = tagStackView.viewWithTag(ViewTag.normal) as? ZatchComponent.PurlpleTag else { return } + + willDisabledTag.isDisabled = true + selectTag.isDisabled = false } - } diff --git a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift index 0b32a9a6..58e49db8 100644 --- a/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift +++ b/Zatch/Presentation/ViewControllers/Register/Zatch/ZatchRegisterFirstViewController.swift @@ -70,12 +70,6 @@ class ZatchRegisterFirstViewController: BaseViewController