From 1128de6ede56319afb668d2f4cf2281366186714 Mon Sep 17 00:00:00 2001 From: dlwns33 Date: Tue, 2 May 2023 13:56:19 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=EA=B7=B8=EB=A3=B9=20=EB=82=B4=20?= =?UTF-8?q?=EB=AA=85=ED=95=A8=20constraint=20=ED=95=9C=EB=B2=88=EB=A7=8C?= =?UTF-8?q?=20=EB=B0=9C=EC=83=9D=EB=90=98=EA=B2=8C=20(#466)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Cells/CardCell/CompanyFrontCardCell.swift | 4 ++++ .../Sources/Cells/CardCell/FanFrontCardCell.swift | 5 +++++ .../Sources/Cells/CardCell/FrontCardCell.swift | 5 +++++ .../BottomSheet/SelectGroupBottomSheetViewController.swift | 4 ++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/CompanyFrontCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/CompanyFrontCardCell.swift index c9bf44ad..8f1662f5 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/CompanyFrontCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/CompanyFrontCardCell.swift @@ -15,6 +15,7 @@ class CompanyFrontCardCell: CardCell { // MARK: - Properties private var cardData: Card? + private var setConstraintDone = false // MARK: - @IBOutlet Properties @IBOutlet weak var backgroundImageView: UIImageView! @@ -97,6 +98,9 @@ extension CompanyFrontCardCell { linkURLStackView.alignment = .center } func setConstraints() { + if setConstraintDone { return } + setConstraintDone = true + let constraints = [titleLabelTop, titleLabelLeading, descLabelTop, userNameLabelTop, birthdayImageTop, mbtiImageLeading, totalStackviewBottom, totalStackviewLeading, totalStackviewTrailing] let labels = [titleLabel, descriptionLabel, userNameLabel, birthLabel, mbtiLabel, phoneNumberLabel, linkURLLabel, mailLabel] diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/FanFrontCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/FanFrontCardCell.swift index d2a4d63e..cd90ddb9 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/FanFrontCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/FanFrontCardCell.swift @@ -14,6 +14,7 @@ class FanFrontCardCell: CardCell { // MARK: - Properties private var cardData: Card? + private var setConstraintDone = false // MARK: - @IBOutlet Properties @IBOutlet weak var backgroundImageView: UIImageView! @@ -90,10 +91,14 @@ extension FanFrontCardCell { secondURLStackView.alignment = .center } func setConstraints() { + if setConstraintDone { return } + setConstraintDone = true + let constraints = [titleLabelTop, titleLabelBottom, titleLabelLeading, userNameBottom, totalStackviewBottom, totalStackviewLeading, totalStackviewTrailing] let labels = [titleLabel, userNameLabel, birthLabel, snsLabel, firstURLLabel, secondURLLabel] let widths = [birthImageViewWidth, snsImageViewWidth, firstUrlWidth, secondUrlWidth] + constraints.forEach { $0?.constant = ($0?.constant ?? 0) * 0.6 } diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift index d35b33b8..e69dcae2 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift @@ -14,6 +14,7 @@ class FrontCardCell: CardCell { // MARK: - Properties private var cardData: Card? + private var setConstraintDone = false // MARK: - @IBOutlet Properties @IBOutlet weak var backgroundImageView: UIImageView! @@ -96,10 +97,14 @@ extension FrontCardCell { linkURLStackView.alignment = .center } func setConstraints() { + if setConstraintDone { return } + setConstraintDone = true + let constraints = [titleLabelTop, titleLabelLeading, descLabelTop, usernameLabelTop, birthdayImageTop, mbtiImageLeading, totalStackViewBottom, totalStackViewLeading, totalStackViewTrailing] let labels = [titleLabel, descriptionLabel, userNameLabel, birthLabel, mbtiLabel, instagramIDLabel, phoneNumberLabel, linkURLLabel] let widths = [birthdayImageWidth, phoneImageWidth, urlImageWidth, mbtiImageWidth] + constraints.forEach { $0?.constant = ($0?.constant ?? 0) * 0.6 } diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectGroupBottomSheetViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectGroupBottomSheetViewController.swift index 6fa8da88..525b8515 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectGroupBottomSheetViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectGroupBottomSheetViewController.swift @@ -168,7 +168,7 @@ extension SelectGroupBottomSheetViewController { } func cardDeleteInGroupWithAPI(cardUuid: String, cardGroupName: String) { - GroupAPI.shared.cardDeleteInGroup(cardUuid: cardUuid, cardGroupName: cardGroupName) { response in + GroupAPI.shared.cardDeleteInGroup(cardUUID: cardUuid, cardGroupName: cardGroupName) { response in switch response { case .success: print("cardDeleteInGroupWithAPI - success") @@ -187,7 +187,7 @@ extension SelectGroupBottomSheetViewController { } func changeGroupWithAPI(cardUuid: String, cardGroupName: String, changingTo: String) { - GroupAPI.shared.cardDeleteInGroup(cardUuid: cardUuid, cardGroupName: cardGroupName) { response in + GroupAPI.shared.cardDeleteInGroup(cardUUID: cardUuid, cardGroupName: cardGroupName) { response in switch response { case .success: print("cardDeleteInGroupWithAPI - success") From 258e9c6b07413ced7f9cd2b621e301f3903dcb11 Mon Sep 17 00:00:00 2001 From: dlwns33 Date: Tue, 2 May 2023 15:34:33 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EB=AF=B8=EB=B6=84=EB=A5=98=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EA=B0=80=EB=8A=A5=ED=95=98=EA=B2=8C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#466)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/NetworkService/Group/GroupService.swift | 13 +++++++++---- .../ViewControllers/Group/GroupViewController.swift | 9 ++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/NADA-iOS-forRelease/Sources/NetworkService/Group/GroupService.swift b/NADA-iOS-forRelease/Sources/NetworkService/Group/GroupService.swift index 052f8040..47353d10 100644 --- a/NADA-iOS-forRelease/Sources/NetworkService/Group/GroupService.swift +++ b/NADA-iOS-forRelease/Sources/NetworkService/Group/GroupService.swift @@ -15,7 +15,7 @@ enum GroupService { case groupEdit(groupRequest: GroupEditRequest) case cardAddInGroup(cardRequest: CardAddInGroupRequest) case cardListFetchInGroup(cardListInGroupRequest: CardListInGroupRequest) - case cardDeleteInGroup(cardUuid: String, cardGroupName: String) + case cardDeleteInGroup(cardUUID: String, cardGroupName: String) case groupReset } @@ -92,9 +92,14 @@ extension GroupService: TargetType { "cardUUID": groupRequest.cardUUID], encoding: JSONEncoding.default) case .cardListFetchInGroup(let cardListInGroupRequest): - return .requestParameters(parameters: ["pageNo": cardListInGroupRequest.pageNo, - "pageSize": cardListInGroupRequest.pageSize, - "groupName": cardListInGroupRequest.groupName], encoding: URLEncoding.queryString) + if cardListInGroupRequest.groupName == "미분류" { + return .requestParameters(parameters: ["pageNo": cardListInGroupRequest.pageNo, + "pageSize": cardListInGroupRequest.pageSize], encoding: URLEncoding.queryString) + } else { + return .requestParameters(parameters: ["pageNo": cardListInGroupRequest.pageNo, + "pageSize": cardListInGroupRequest.pageSize, + "groupName": cardListInGroupRequest.groupName], encoding: URLEncoding.queryString) + } } } diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/Group/GroupViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/Group/GroupViewController.swift index 0091d16c..3f4641df 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/Group/GroupViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/Group/GroupViewController.swift @@ -94,7 +94,7 @@ class GroupViewController: UIViewController { var serverGroups: [String]? = [] var frontCards: [Card]? = [] var serverCardsWithBack: Card? - var groupName: String = "" + var groupName: String = "미분류" var selectedRow = 0 private var offset = 0 @@ -187,7 +187,6 @@ extension GroupViewController { self.serverGroups = group self.groupCollectionView.reloadData() print("selectedRow: ", self.selectedRow) - if group[self.selectedRow] != "미분류" { self.groupName = group[self.selectedRow] } self.cardListInGroupWithAPI(cardListInGroupRequest: CardListInGroupRequest(pageNo: 1, pageSize: 6, groupName: self.groupName)) { if self.frontCards?.count != 0 { self.cardsCollectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .top, animated: false) @@ -347,11 +346,7 @@ extension GroupViewController: UICollectionViewDataSource { switch collectionView { case groupCollectionView: selectedRow = indexPath.row - if selectedRow == 0 { - self.groupName = "" - } else { - self.groupName = serverGroups?[indexPath.row] ?? "" - } + self.groupName = serverGroups?[indexPath.row] ?? "" offset = 0 frontCards?.removeAll() From 710021c8354bddd5ff8fea9f48e3f580298a175a Mon Sep 17 00:00:00 2001 From: dlwns33 Date: Tue, 2 May 2023 19:02:40 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=EB=94=A5=EB=A7=81=ED=81=AC?= =?UTF-8?q?=EB=A1=9C=20=EB=84=98=EC=96=B4=EC=98=A4=EB=8A=94=20=EA=B2=83=20?= =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20=EC=9D=B4=EB=A6=84=20=EB=AF=B8=EB=B6=84?= =?UTF-8?q?=EB=A5=98=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#466)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ViewControllers/Home/VC/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/Home/VC/HomeViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/Home/VC/HomeViewController.swift index 26d1656f..42687fc1 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/Home/VC/HomeViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/Home/VC/HomeViewController.swift @@ -293,7 +293,7 @@ extension HomeViewController { } } private func cardAddInGroupWithAPI(cardUUID: String, completion: @escaping () -> Void) { - GroupAPI.shared.cardAddInGroup(cardRequest: CardAddInGroupRequest(cardGroupName: nil, cardUUID: cardUUID)) { response in + GroupAPI.shared.cardAddInGroup(cardRequest: CardAddInGroupRequest(cardGroupName: "미분류", cardUUID: cardUUID)) { response in switch response { case .success: completion()