From 0a5d36965fcee5f6bc6c86fb33151ef0a544374a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 29 Feb 2024 17:45:54 +0900 Subject: [PATCH 1/4] [Chore] #248 - fixed emptycollectionview label alignment --- .../Presentation/Search/Cell/EmptyCollectionViewCell.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEON-PPANG-iOS/Presentation/Search/Cell/EmptyCollectionViewCell.swift b/GEON-PPANG-iOS/Presentation/Search/Cell/EmptyCollectionViewCell.swift index 87172f48..b973a020 100644 --- a/GEON-PPANG-iOS/Presentation/Search/Cell/EmptyCollectionViewCell.swift +++ b/GEON-PPANG-iOS/Presentation/Search/Cell/EmptyCollectionViewCell.swift @@ -97,7 +97,6 @@ final class EmptyCollectionViewCell: UICollectionViewCell { emptyLabel.do { $0.numberOfLines = 0 $0.basic(font: .title2!, color: .gbbGray300!, align: .center) - $0.textAlignment = .center } } @@ -117,7 +116,8 @@ final class EmptyCollectionViewCell: UICollectionViewCell { case .initialize, .noReview, .noMyReview, .noBookmark: return emptyLabel.basic(text: emptyType.rawValue, font: .title2!, - color: .gbbGray300!) + color: .gbbGray300!, + align: .center) case .noSearch: return emptyLabel.partFontChange(targetString: type.subTitle, font: .subHead!) } From 3ee87a65fc450121a733a439bedb769684af968a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 29 Feb 2024 17:59:10 +0900 Subject: [PATCH 2/4] [Chore] #248 - disappearing link section fixed --- .../Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift b/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift index 8d6040ab..1e6be527 100644 --- a/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift +++ b/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift @@ -188,6 +188,7 @@ final class InfoCollectionViewCell: UICollectionViewCell { if data.homepageURL == "" && data.instagramURL == "" { linkSection.isHidden = true } else { + linkSection.isHidden = false linkButtonStackView.getLinkStatus(data.homepageURL, data.instagramURL) } addressLabel.text = data.address From 50e5e3fbacdcf1116fa958b12d215fd4b6351e2a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 28 Mar 2024 15:44:17 +0900 Subject: [PATCH 3/4] [FIX] time text label resizing to fit --- .../BakeryDetail/Cell/InfoCollectionViewCell.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift b/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift index 1e6be527..4bc704de 100644 --- a/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift +++ b/GEON-PPANG-iOS/Presentation/BakeryDetail/Cell/InfoCollectionViewCell.swift @@ -96,11 +96,12 @@ final class InfoCollectionViewCell: UICollectionViewCell { openingHoursSection.addSubview(closedDaysLabel) closedDaysLabel.snp.makeConstraints { $0.leading.equalTo(openingHoursImage.snp.trailing).offset(10) + $0.trailing.equalToSuperview() $0.top.equalToSuperview() } openingHoursSection.addSubview(openingHoursLabel) openingHoursLabel.snp.makeConstraints { - $0.leading.equalTo(closedDaysLabel) + $0.horizontalEdges.equalTo(closedDaysLabel) $0.top.equalTo(closedDaysLabel.snp.bottom).offset(2) $0.bottom.equalToSuperview() } From ba219f611ce11014597319f0147d3ee6417a238d Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 28 Mar 2024 16:14:57 +0900 Subject: [PATCH 4/4] [Fix] #248 - separated getBakeryDetail and written reviews api --- .../BakeryDetailViewController.swift | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/GEON-PPANG-iOS/Presentation/BakeryDetail/ViewControllers/BakeryDetailViewController.swift b/GEON-PPANG-iOS/Presentation/BakeryDetail/ViewControllers/BakeryDetailViewController.swift index dcd05323..02670dc3 100644 --- a/GEON-PPANG-iOS/Presentation/BakeryDetail/ViewControllers/BakeryDetailViewController.swift +++ b/GEON-PPANG-iOS/Presentation/BakeryDetail/ViewControllers/BakeryDetailViewController.swift @@ -52,12 +52,18 @@ final class BakeryDetailViewController: BaseViewController { // MARK: - Life Cycle + override func viewDidLoad() { + super.viewDidLoad() + + guard let bakeryID = self.bakeryID else { return } + getBakeryDetail(bakeryID: bakeryID) + } + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) guard let bakeryID = self.bakeryID else { return } - - getBakeryDetail(bakeryID: bakeryID, isUpdated: true) + getWrittenReviews(bakeryID: bakeryID, isUpdated: true) navigationController?.interactivePopGestureRecognizer?.delegate = nil // swipe back gesture } @@ -414,7 +420,7 @@ extension BakeryDetailViewController: UICollectionViewDelegateFlowLayout { extension BakeryDetailViewController { - func getBakeryDetail(bakeryID: Int, isUpdated: Bool) { + func getBakeryDetail(bakeryID: Int) { BakeriesAPI.shared.getBakeryDetail(bakeryID: bakeryID) { response in @@ -427,7 +433,6 @@ extension BakeryDetailViewController { self.detailBottomView.configureBookmarkButton(to: data.isBookMarked) self.homepageURL = data.homepageURL self.instagramURL = data.instagramURL - self.getWrittenReviews(bakeryID: bakeryID, isUpdated: isUpdated) } } @@ -455,7 +460,7 @@ extension BakeryDetailViewController { AnalyticManager.log(event: .detail(.clickMystore)) self.detailBottomView.configureBookmarkButton(to: value) self.isBookmarked = value - self.getBakeryDetail(bakeryID: bakeryID, isUpdated: false) + self.getBakeryDetail(bakeryID: bakeryID) } }