From 419e4cb3140381b47323bff5494346a27434d023 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Sun, 27 Jul 2025 20:49:36 +0900 Subject: [PATCH 01/29] =?UTF-8?q?feat/#161:=20=EC=95=84=ED=86=A0=EB=AF=B9?= =?UTF-8?q?=20=ED=8F=B0=ED=8A=B8=20=EC=8B=9C=EC=8A=A4=ED=85=9C=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Font/FontSystem.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift new file mode 100644 index 00000000..8d47d07b --- /dev/null +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift @@ -0,0 +1,15 @@ +import Foundation + +public enum FontStyle { + // 한국어 Typeface Guide + case KOl32, KOl28, KOl24, KOl20, KOl18, KOl16, KOl15, KOl14, KOl13, KOl12, KOl11 + case KOr32, KOr28, KOr24, KOr20, KOr18, KOr16, KOr15, KOr14, KOr13, KOr12, KOr11 + case KOm32, KOm28, KOm24, KOm20, KOm18, KOm16, KOm15, KOm14, KOm13, KOm12, KOm11 + case KOb32, KOb28, KOb24, KOb20, KOb18, KOb16, KOb15, KOb14, KOb13, KOb12, KOb11 + + // 영어 Typeface Guide + case ENl32, ENl28, ENl24, ENl20, ENl18, ENl16, ENl15, ENl14, ENl13, ENl12, ENl11 + case ENr32, ENr28, ENr24, ENr20, ENr18, ENr16, ENr15, ENr14, ENr13, ENr12, ENr11 + case ENm32, ENm28, ENm24, ENm20, ENm18, ENm16, ENm15, ENm14, ENm13, ENm12, ENm11 + case ENb32, ENb28, ENb24, ENb20, ENb18, ENb16, ENb15, ENb14, ENb13, ENb12, ENb11 +} From 5be94f5b021ae3a193bafacc9236f5ce2f60464d Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Sun, 27 Jul 2025 21:36:06 +0900 Subject: [PATCH 02/29] =?UTF-8?q?feat/#161:=20=ED=8F=B0=ED=8A=B8=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=86=8D=EC=84=B1=20=EC=A0=95?= =?UTF-8?q?=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Font/FontSystem.swift | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift index 8d47d07b..5cb88638 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift @@ -1,5 +1,8 @@ + import Foundation +import UIKit +// MARK: - Font cases public enum FontStyle { // 한국어 Typeface Guide case KOl32, KOl28, KOl24, KOl20, KOl18, KOl16, KOl15, KOl14, KOl13, KOl12, KOl11 @@ -13,3 +16,64 @@ public enum FontStyle { case ENm32, ENm28, ENm24, ENm20, ENm18, ENm16, ENm15, ENm14, ENm13, ENm12, ENm11 case ENb32, ENb28, ENb24, ENb20, ENb18, ENb16, ENb15, ENb14, ENb13, ENb12, ENb11 } + +// MARK: - Font size +extension FontStyle { + /// 폰트 패밀리 크기 + public var pointSize: CGFloat { + switch self { + case .KOl32, .KOr32, .KOm32, .KOb32, .ENl32, .ENr32, .ENm32, .ENb32: return 32 + case .KOl28, .KOr28, .KOm28, .KOb28, .ENl28, .ENr28, .ENm28, .ENb28: return 28 + case .KOl24, .KOr24, .KOm24, .KOb24, .ENl24, .ENr24, .ENm24, .ENb24: return 24 + case .KOl20, .KOr20, .KOm20, .KOb20, .ENl20, .ENr20, .ENm20, .ENb20: return 20 + case .KOl18, .KOr18, .KOm18, .KOb18, .ENl18, .ENr18, .ENm18, .ENb18: return 18 + case .KOl16, .KOr16, .KOm16, .KOb16, .ENl16, .ENr16, .ENm16, .ENb16: return 16 + case .KOl15, .KOr15, .KOm15, .KOb15, .ENl15, .ENr15, .ENm15, .ENb15: return 15 + case .KOl14, .KOr14, .KOm14, .KOb14, .ENl14, .ENr14, .ENm14, .ENb14: return 14 + case .KOl13, .KOr13, .KOm13, .KOb13, .ENl13, .ENr13, .ENm13, .ENb13: return 13 + case .KOl12, .KOr12, .KOm12, .KOb12, .ENl12, .ENr12, .ENm12, .ENb12: return 12 + case .KOl11, .KOr11, .KOm11, .KOb11, .ENl11, .ENr11, .ENm11, .ENb11: return 11 + } + } +} + +// MARK: - Font name +extension FontStyle { + /// 폰트 패밀리 이름 + public var fontName: String { + switch self { + case .KOl32, .KOl28, .KOl24, .KOl20, .KOl18, .KOl16, .KOl15, .KOl14, .KOl13, .KOl12, .KOl11: return "GothicA1-Light" + case .KOr32, .KOr28, .KOr24, .KOr20, .KOr18, .KOr16, .KOr15, .KOr14, .KOr13, .KOr12, .KOr11: return "GothicA1-Regular" + case .KOm32, .KOm28, .KOm24, .KOm20, .KOm18, .KOm16, .KOm15, .KOm14, .KOm13, .KOm12, .KOm11: return "GothicA1-Medium" + case .KOb32, .KOb28, .KOb24, .KOb20, .KOb18, .KOb16, .KOb15, .KOb14, .KOb13, .KOb12, .KOb11: return "GothicA1-Bold" + + case .ENl32, .ENl28, .ENl24, .ENl20, .ENl18, .ENl16, .ENl15, .ENl14, .ENl13, .ENl12, .ENl11: return "Poppins-Light" + case .ENr32, .ENr28, .ENr24, .ENr20, .ENr18, .ENr16, .ENr15, .ENr14, .ENr13, .ENr12, .ENr11: return "Poppins-Regular" + case .ENm32, .ENm28, .ENm24, .ENm20, .ENm18, .ENm16, .ENm15, .ENm14, .ENm13, .ENm12, .ENm11: return "Poppins-Medium" + case .ENb32, .ENb28, .ENb24, .ENb20, .ENb18, .ENb16, .ENb15, .ENb14, .ENb13, .ENb12, .ENb11: return "Poppins-Bold" + } + } +} + +// MARK: - Font line height +extension FontStyle { + /// 폰트 패밀리 행간 + public var lineHeight: CGFloat { + switch self { + // + case .KOl28, .KOl24, .KOl20, .KOl18, .KOl16, .KOl15, .KOl14, .KOl13, .KOl12, .KOl11, + .KOr28, .KOr24, .KOr20, .KOr18, .KOr16, .KOr15, .KOr14, .KOr13, .KOr12, .KOr11, + .KOm28, .KOm24, .KOm20, .KOm18, .KOm16, .KOm15, .KOm14, .KOm13, .KOm12, .KOm11: + return 1.5 + + case .KOl32, .KOr32, .KOm32, .KOb32, .KOb28, .KOb24, .KOb20, .KOb18, .KOb16, .KOb15, .KOb14, .KOb13, .KOb12, .KOb11: + return 1.4 + + case .ENl32, .ENl28, .ENl24, .ENl20, .ENl18, .ENl16, .ENl15, .ENl14, .ENl13, .ENl12, .ENl11, + .ENr32, .ENr28, .ENr24, .ENr20, .ENr18, .ENr16, .ENr15, .ENr14, .ENr13, .ENr12, .ENr11, + .ENm32, .ENm28, .ENm24, .ENm20, .ENm18, .ENm16, .ENm15, .ENm14, .ENm13, .ENm12, .ENm11, + .ENb32, .ENb28, .ENb24, .ENb20, .ENb18, .ENb16, .ENb15, .ENb14, .ENb13, .ENb12, .ENb11: + return 1.35 + } + } +} From a00b6307d1ea412f921054321815c83aad5e1c68 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Sun, 27 Jul 2025 21:51:49 +0900 Subject: [PATCH 03/29] =?UTF-8?q?refactor/#161:=20=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Font/FontSystem.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift index 5cb88638..6280e8c3 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift @@ -3,7 +3,7 @@ import Foundation import UIKit // MARK: - Font cases -public enum FontStyle { +public enum PoppoolFont { // 한국어 Typeface Guide case KOl32, KOl28, KOl24, KOl20, KOl18, KOl16, KOl15, KOl14, KOl13, KOl12, KOl11 case KOr32, KOr28, KOr24, KOr20, KOr18, KOr16, KOr15, KOr14, KOr13, KOr12, KOr11 @@ -18,9 +18,9 @@ public enum FontStyle { } // MARK: - Font size -extension FontStyle { +extension PoppoolFont { /// 폰트 패밀리 크기 - public var pointSize: CGFloat { + public var size: CGFloat { switch self { case .KOl32, .KOr32, .KOm32, .KOb32, .ENl32, .ENr32, .ENm32, .ENb32: return 32 case .KOl28, .KOr28, .KOm28, .KOb28, .ENl28, .ENr28, .ENm28, .ENb28: return 28 @@ -38,7 +38,7 @@ extension FontStyle { } // MARK: - Font name -extension FontStyle { +extension PoppoolFont { /// 폰트 패밀리 이름 public var fontName: String { switch self { @@ -56,7 +56,7 @@ extension FontStyle { } // MARK: - Font line height -extension FontStyle { +extension PoppoolFont { /// 폰트 패밀리 행간 public var lineHeight: CGFloat { switch self { From bea805f8ae434e940d370808285d5d0af8344987 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Sun, 27 Jul 2025 21:54:04 +0900 Subject: [PATCH 04/29] =?UTF-8?q?feat/#161:=20=EC=83=88=EB=A1=9C=20?= =?UTF-8?q?=EC=A0=95=EC=9D=98=ED=95=9C=20=ED=8F=B0=ED=8A=B8=20=EC=8B=9C?= =?UTF-8?q?=EC=8A=A4=ED=85=9C=20=EA=B8=B0=EB=B0=98=EC=9D=98=20=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=ED=85=80=20=ED=8F=B0=ED=8A=B8=20extension=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Extension/UIFont+.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift index 9723e545..47e4ce05 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift @@ -21,6 +21,14 @@ public extension UIFont { if let font = UIFont(name: fontName, size: size) { return font } else { return registerAndGetFont(name: fontName, size: size) } } + static func poppoolFont(style: PoppoolFont) -> UIFont { + if let font = UIFont(name: style.fontName, size: style.size) { + return font + } else { + return registerAndGetFont(name: style.fontName, size: style.size) + } + } + private static func registerAndGetFont(name: String, size: CGFloat) -> UIFont { let url = Bundle.module.url(forResource: name, withExtension: "ttf")! CTFontManagerRegisterFontURLs([url as CFURL] as CFArray, .process, true, nil) From 6b54f3e5cfdaef581e317271ff39cfb7e94074b1 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Sun, 27 Jul 2025 21:57:08 +0900 Subject: [PATCH 05/29] =?UTF-8?q?feat/#161:=20=EB=9D=BC=EB=B2=A8=20?= =?UTF-8?q?=EC=86=8D=EC=84=B1=20=EC=9C=A0=EC=A7=80=ED=95=9C=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=B3=80=EA=B2=BD=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Extension/UILabel+.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift index eb0caec1..b560b303 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift @@ -14,4 +14,14 @@ public extension UILabel { ] ) } + + /// 기존 attributedText 속성을 유지하며 텍스트만 교체합니다. + func setText(to text: String) { + guard let current = self.attributedText, current.length > 0 else { + self.text = text + return + } + let attributes = current.attributes(at: 0, effectiveRange: nil) + self.attributedText = NSAttributedString(string: text, attributes: attributes) + } } From 8bb70574ce6fb6f744eb61b6a86bc0048c2890e8 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Sun, 27 Jul 2025 22:00:20 +0900 Subject: [PATCH 06/29] =?UTF-8?q?feat/#161:=20=EC=83=88=EB=A1=9C=EC=9A=B4?= =?UTF-8?q?=20PPLabel=20=EC=83=9D=EC=84=B1=EC=9E=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Components/PPLabel.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index d27c4daf..bcc2237a 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -18,6 +18,19 @@ public class PPLabel: UILabel { ) } + public init(text: String, style: PoppoolFont) { + super.init(frame: .zero) + + self.font = .poppoolFont(style: style) + + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineHeightMultiple = style.lineHeight + + self.attributedText = NSMutableAttributedString( + string: text, attributes: [.paragraphStyle: paragraphStyle] + ) + } + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } From d3854844c6a09a39c28c2fbb5062bac230d2056a Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 12:36:47 +0900 Subject: [PATCH 07/29] =?UTF-8?q?refactor/#161:=20Attribute=20=EC=9C=A0?= =?UTF-8?q?=EC=A7=80=ED=95=B4=EC=A3=BC=EB=8A=94=20text=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Font/FontSystem.swift | 1 - .../CatagorySelect/View/CategorySelectView.swift | 4 +--- .../FilterSelector/View/FilterSelectView.swift | 6 +++--- .../SearchResultEmptyCollectionViewCell.swift | 8 ++------ .../SearchResultHeaderCollectionViewCell.swift | 15 ++++++++------- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift index 6280e8c3..e510b743 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift @@ -60,7 +60,6 @@ extension PoppoolFont { /// 폰트 패밀리 행간 public var lineHeight: CGFloat { switch self { - // case .KOl28, .KOl24, .KOl20, .KOl18, .KOl16, .KOl15, .KOl14, .KOl13, .KOl12, .KOl11, .KOr28, .KOr24, .KOr20, .KOr18, .KOr16, .KOr15, .KOr14, .KOr13, .KOr12, .KOr11, .KOm28, .KOm24, .KOm20, .KOm18, .KOm16, .KOm15, .KOm14, .KOm13, .KOm12, .KOm11: diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/CatagorySelect/View/CategorySelectView.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/CatagorySelect/View/CategorySelectView.swift index 0dcdd526..b2a709c1 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/CatagorySelect/View/CategorySelectView.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/CatagorySelect/View/CategorySelectView.swift @@ -8,9 +8,7 @@ import Then final class CategorySelectView: UIView { // MARK: - Components - private let titleLabel: PPLabel = { - return PPLabel(style: .bold, fontSize: 18, text: "카테고리를 선택해주세요") - }() + private let titleLabel = PPLabel(text: "카테고리를 선택해주세요", style: .KOb18) let closeButton = UIButton().then { $0.setImage(UIImage(named: "icon_xmark"), for: .normal) diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/FilterSelector/View/FilterSelectView.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/FilterSelector/View/FilterSelectView.swift index efbbb69a..8984f08f 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/FilterSelector/View/FilterSelectView.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/FilterSelector/View/FilterSelectView.swift @@ -7,17 +7,17 @@ import SnapKit final class FilterSelectView: UIView { // MARK: - Components - private let titleLabel = PPLabel(style: .bold, fontSize: 18, text: "노출 순서를 선택해주세요") + private let titleLabel = PPLabel(text: "노출 순서를 선택해주세요", style: .KOb18) let closeButton = UIButton().then { $0.setImage(UIImage(named: "icon_xmark"), for: .normal) } - private let statusLabel = PPLabel(style: .regular, fontSize: 13, text: "노출 조건") + private let statusLabel = PPLabel(text: "노출 조건", style: .KOr13) let statusSegmentControl = PPSegmentedControl(type: .base, segments: ["오픈", "종료"], selectedSegmentIndex: 0) - private let sortLabel = PPLabel(style: .regular, fontSize: 13, text: "팝업순서") + private let sortLabel = PPLabel(text: "팝업순서", style: .KOr13) let sortSegmentControl = PPSegmentedControl(type: .base, segments: ["신규순", "인기순"], selectedSegmentIndex: 0) diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift index 9a82752c..38a1cbf5 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift @@ -9,11 +9,7 @@ import Then final class SearchResultEmptyCollectionViewCell: UICollectionViewCell { // MARK: - Properties - private let emptyLabel = PPLabel( - style: .medium, - fontSize: 14, - lineHeight: 1.5 - ).then { + private let emptyLabel = PPLabel(style: .KOm14).then { $0.textAlignment = .center $0.numberOfLines = 2 $0.textColor = .g400 @@ -54,6 +50,6 @@ private extension SearchResultEmptyCollectionViewCell { extension SearchResultEmptyCollectionViewCell { func configureCell(title: String) { - self.emptyLabel.text = title + self.emptyLabel.setText(to: title) } } diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift index 518bac1a..ae344d92 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift @@ -12,15 +12,16 @@ public final class SearchResultHeaderCollectionViewCell: UICollectionViewCell { var disposeBag = DisposeBag() - private let afterSearchTitleLabel = PPLabel(style: .bold, fontSize: 16).then { + + private let afterSearchTitleLabel = PPLabel(style: .KOb16).then { $0.isHidden = true } - private let cellCountLabel = PPLabel(style: .regular, fontSize: 13).then { + private let cellCountLabel = PPLabel(style: .KOr13).then { $0.textColor = .g400 } - private let filterStatusLabel = PPLabel(style: .regular, fontSize: 13) + private let filterStatusLabel = PPLabel(style: .KOr13) private let dropDownImageView = UIImageView().then { $0.image = UIImage(named: "icon_dropdown") @@ -100,8 +101,8 @@ extension SearchResultHeaderCollectionViewCell { let count = count { filterStatusButton.isHidden = true afterSearchTitleLabel.isHidden = false - afterSearchTitleLabel.text = afterSearchTitle + " 포함된 팝업" - cellCountLabel.text = "총 \(count)개를 찾았어요." + afterSearchTitleLabel.setText(to: afterSearchTitle + " 포함된 팝업") + cellCountLabel.setText(to: "총 \(count)개를 찾았어요.") if count == 0 { self.isHidden = true } else { self.isHidden = false @@ -113,8 +114,8 @@ extension SearchResultHeaderCollectionViewCell { } else if let count, let filterText { filterStatusButton.isHidden = false afterSearchTitleLabel.isHidden = true - cellCountLabel.text = "총 \(count)개" - filterStatusLabel.text = filterText + cellCountLabel.setText(to: "총 \(count)개") + filterStatusLabel.setText(to: filterText) self.isHidden = false afterSearchTitleLabel.snp.updateConstraints { make in From ad02e7504a24cc3f487ef9abc2a9e4d7bb94c838 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 12:37:04 +0900 Subject: [PATCH 08/29] =?UTF-8?q?fix/#161:=20Attribute=EA=B0=80=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8D=98=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Components/PPLabel.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index bcc2237a..513c4c87 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -18,7 +18,10 @@ public class PPLabel: UILabel { ) } - public init(text: String, style: PoppoolFont) { + public init( + text: String = " ", // 값이 없으면 Attribute가 적용이 안돼서 기본값은 공백 + style: PoppoolFont + ) { super.init(frame: .zero) self.font = .poppoolFont(style: style) From 431816f4b141e5c9ef1269d18153f14d9c57c94e Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 12:41:52 +0900 Subject: [PATCH 09/29] =?UTF-8?q?refactor/#161:=20=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Components/PPLabel.swift | 2 +- .../DesignSystem/DesignSystem/Extension/UIFont+.swift | 2 +- .../Font/{FontSystem.swift => PPFontStyle.swift} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/{FontSystem.swift => PPFontStyle.swift} (97%) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index 513c4c87..be304c58 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -20,7 +20,7 @@ public class PPLabel: UILabel { public init( text: String = " ", // 값이 없으면 Attribute가 적용이 안돼서 기본값은 공백 - style: PoppoolFont + style: PPFontStyle ) { super.init(frame: .zero) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift index 47e4ce05..c7177be2 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift @@ -21,7 +21,7 @@ public extension UIFont { if let font = UIFont(name: fontName, size: size) { return font } else { return registerAndGetFont(name: fontName, size: size) } } - static func poppoolFont(style: PoppoolFont) -> UIFont { + static func poppoolFont(style: PPFontStyle) -> UIFont { if let font = UIFont(name: style.fontName, size: style.size) { return font } else { diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift similarity index 97% rename from Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift rename to Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift index e510b743..2bb464bd 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/FontSystem.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift @@ -3,7 +3,7 @@ import Foundation import UIKit // MARK: - Font cases -public enum PoppoolFont { +public enum PPFontStyle { // 한국어 Typeface Guide case KOl32, KOl28, KOl24, KOl20, KOl18, KOl16, KOl15, KOl14, KOl13, KOl12, KOl11 case KOr32, KOr28, KOr24, KOr20, KOr18, KOr16, KOr15, KOr14, KOr13, KOr12, KOr11 @@ -18,7 +18,7 @@ public enum PoppoolFont { } // MARK: - Font size -extension PoppoolFont { +extension PPFontStyle { /// 폰트 패밀리 크기 public var size: CGFloat { switch self { @@ -38,7 +38,7 @@ extension PoppoolFont { } // MARK: - Font name -extension PoppoolFont { +extension PPFontStyle { /// 폰트 패밀리 이름 public var fontName: String { switch self { @@ -56,7 +56,7 @@ extension PoppoolFont { } // MARK: - Font line height -extension PoppoolFont { +extension PPFontStyle { /// 폰트 패밀리 행간 public var lineHeight: CGFloat { switch self { From 59036b6e7f62f7476bb4f30073a8ac1198456b3c Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 12:43:27 +0900 Subject: [PATCH 10/29] =?UTF-8?q?refactor/#161:=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Components/PPLabel.swift | 2 +- .../DesignSystem/DesignSystem/Extension/UIFont+.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index be304c58..baf8fe18 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -24,7 +24,7 @@ public class PPLabel: UILabel { ) { super.init(frame: .zero) - self.font = .poppoolFont(style: style) + self.font = .PPFont(style: style) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineHeightMultiple = style.lineHeight diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift index c7177be2..dc303a58 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIFont+.swift @@ -21,7 +21,7 @@ public extension UIFont { if let font = UIFont(name: fontName, size: size) { return font } else { return registerAndGetFont(name: fontName, size: size) } } - static func poppoolFont(style: PPFontStyle) -> UIFont { + static func PPFont(style: PPFontStyle) -> UIFont { if let font = UIFont(name: style.fontName, size: style.size) { return font } else { From a415b7f71bb76d66275058811aead7d2be42167b Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 12:48:41 +0900 Subject: [PATCH 11/29] =?UTF-8?q?feat/#161:=20TextField=20placeholder?= =?UTF-8?q?=EC=97=90=20=ED=83=80=EC=9D=B4=ED=8F=AC=20=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Components/PPSearchBarView.swift | 6 +++++- .../DesignSystem/Extension/UITextField+.swift | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPSearchBarView.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPSearchBarView.swift index 0306def6..f971da5e 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPSearchBarView.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPSearchBarView.swift @@ -12,7 +12,11 @@ public class PPSearchBarView: UIView { } public let searchBar = UISearchBar().then { - $0.searchTextField.setPlaceholder(text: "팝업스토어명을 입력해보세요", color: .g400, font: .korFont(style: .regular, size: 14)) + $0.searchTextField.setPlaceholder( + text: "팝업스토어명을 입력해보세요", + color: .g400, + style: .KOr14 + ) $0.tintColor = .g400 $0.backgroundColor = .g50 $0.layer.cornerRadius = 4 diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift index 883720b9..596b0281 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift @@ -7,4 +7,14 @@ public extension UITextField { attributes: [.foregroundColor: color, .font: font] ) } + + func setPlaceholder(text: String, color: UIColor, style: PPFontStyle) { + self.attributedPlaceholder = NSAttributedString( + string: text, + attributes: [ + .foregroundColor: color, + .font: UIFont.PPFont(style: style) + ] + ) + } } From 0e5d7e5b47a03e2a6aa9e2915677213451e9e0f0 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 13:37:22 +0900 Subject: [PATCH 12/29] =?UTF-8?q?feat/#161:=20=ED=96=89=EA=B0=84=20?= =?UTF-8?q?=EB=B0=B0=EC=9C=A8=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=EC=8B=A4?= =?UTF-8?q?=EC=A0=9C=20=ED=96=89=EA=B0=84=20=EA=B0=92=EC=9D=84=20=ED=83=80?= =?UTF-8?q?=EC=9D=B4=ED=8F=AC=EC=8B=9C=EC=8A=A4=ED=85=9C=EC=97=90=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 --- .../DesignSystem/Font/PPFontStyle.swift | 17 +++++++++++++++-- .../SearchFeatureDemo/Resource/Info.plist | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift index 2bb464bd..30ef5f93 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift @@ -57,8 +57,8 @@ extension PPFontStyle { // MARK: - Font line height extension PPFontStyle { - /// 폰트 패밀리 행간 - public var lineHeight: CGFloat { + /// 폰트 패밀리 행간 배율 + public var lineHeightMultiple: CGFloat { switch self { case .KOl28, .KOl24, .KOl20, .KOl18, .KOl16, .KOl15, .KOl14, .KOl13, .KOl12, .KOl11, .KOr28, .KOr24, .KOr20, .KOr18, .KOr16, .KOr15, .KOr14, .KOr13, .KOr12, .KOr11, @@ -75,4 +75,17 @@ extension PPFontStyle { return 1.35 } } + + /// 폰트 패밀리 행간 + public var lineHeight: CGFloat { + return (size * lineHeightMultiple).rounded() + } + + public var baseLineOffset: CGFloat { + if #available(iOS 16.4, *) { + return (lineHeight - size) / 2 + } else { + return (lineHeight - size) / 4 + } + } } diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeatureDemo/Resource/Info.plist b/Poppool/PresentationLayer/SearchFeature/SearchFeatureDemo/Resource/Info.plist index a343d54d..ade6bb80 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeatureDemo/Resource/Info.plist +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeatureDemo/Resource/Info.plist @@ -2,6 +2,11 @@ + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + UIUserInterfaceStyle Light UIAppFonts From 1fc7ef8da4b34df5f22d0b410dcd051af973b19f Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 13:37:46 +0900 Subject: [PATCH 13/29] =?UTF-8?q?fix/#161:=20placeholder=EC=9D=98=20?= =?UTF-8?q?=ED=96=89=EA=B0=84=EC=9D=B4=20=EB=A7=9E=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Extension/UITextField+.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift index 596b0281..2054df2b 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift @@ -9,11 +9,20 @@ public extension UITextField { } func setPlaceholder(text: String, color: UIColor, style: PPFontStyle) { + let paragraphStyle = NSMutableParagraphStyle() + let font = UIFont.PPFont(style: style) + + paragraphStyle.lineHeightMultiple = style.lineHeightMultiple + paragraphStyle.maximumLineHeight = style.lineHeight + paragraphStyle.minimumLineHeight = style.lineHeight + self.attributedPlaceholder = NSAttributedString( string: text, attributes: [ .foregroundColor: color, - .font: UIFont.PPFont(style: style) + .paragraphStyle: paragraphStyle, + .baselineOffset: style.baseLineOffset, + .font: font ] ) } From 59c48bb04e046c9aaf4fe2e2688d256ba5f37e62 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 14:31:41 +0900 Subject: [PATCH 14/29] =?UTF-8?q?refactor/#161:=20PPLabel=EC=97=90=20lineH?= =?UTF-8?q?eight=20=EA=B3=A0=EC=A0=95=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Components/PPLabel.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index baf8fe18..24238cbc 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -24,13 +24,18 @@ public class PPLabel: UILabel { ) { super.init(frame: .zero) - self.font = .PPFont(style: style) - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineHeightMultiple = style.lineHeight + paragraphStyle.lineHeightMultiple = style.lineHeightMultiple + paragraphStyle.maximumLineHeight = style.lineHeight + paragraphStyle.minimumLineHeight = style.lineHeight self.attributedText = NSMutableAttributedString( - string: text, attributes: [.paragraphStyle: paragraphStyle] + string: text, + attributes: [ + .font: UIFont.PPFont(style: style), + .paragraphStyle: paragraphStyle, + .baselineOffset: style.baseLineOffset + ] ) } From 1972091a4a2c98db6e3e4ab5b32ba36e13c72dac Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 15:02:57 +0900 Subject: [PATCH 15/29] =?UTF-8?q?refactor/#161:=20Text=20Attribute=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EC=9D=84=20UILabel=EC=9D=98=20Extension?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Components/PPLabel.swift | 15 +-------------- .../DesignSystem/Extension/UILabel+.swift | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index 24238cbc..4fa25f67 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -23,20 +23,7 @@ public class PPLabel: UILabel { style: PPFontStyle ) { super.init(frame: .zero) - - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineHeightMultiple = style.lineHeightMultiple - paragraphStyle.maximumLineHeight = style.lineHeight - paragraphStyle.minimumLineHeight = style.lineHeight - - self.attributedText = NSMutableAttributedString( - string: text, - attributes: [ - .font: UIFont.PPFont(style: style), - .paragraphStyle: paragraphStyle, - .baselineOffset: style.baseLineOffset - ] - ) + self.setText(to: text, with: style) } required init?(coder: NSCoder) { diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift index b560b303..6d473b2b 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift @@ -24,4 +24,21 @@ public extension UILabel { let attributes = current.attributes(at: 0, effectiveRange: nil) self.attributedText = NSAttributedString(string: text, attributes: attributes) } + + /// Style이 포함된 텍스트를 적용합니다. + func setText(to text: String, with style: PPFontStyle) { + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineHeightMultiple = style.lineHeightMultiple + paragraphStyle.maximumLineHeight = style.lineHeight + paragraphStyle.minimumLineHeight = style.lineHeight + + self.attributedText = NSMutableAttributedString( + string: text, + attributes: [ + .font: UIFont.PPFont(style: style), + .paragraphStyle: paragraphStyle, + .baselineOffset: style.baseLineOffset + ] + ) + } } From 1d04a27b76f9c70f33847308f4b79b698d96ceb2 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 15:03:51 +0900 Subject: [PATCH 16/29] =?UTF-8?q?refactor/#161:=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - setText는 초기 설정처럼 보임 - Text만 교체시에는 update가 적절하다 판단하여 메서드명 교체 --- .../DesignSystem/DesignSystem/Extension/UILabel+.swift | 2 +- .../Cell/SearchResultEmptyCollectionViewCell.swift | 2 +- .../Cell/SearchResultHeaderCollectionViewCell.swift | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift index 6d473b2b..e2f2719a 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift @@ -16,7 +16,7 @@ public extension UILabel { } /// 기존 attributedText 속성을 유지하며 텍스트만 교체합니다. - func setText(to text: String) { + func updateText(to text: String) { guard let current = self.attributedText, current.length > 0 else { self.text = text return diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift index 38a1cbf5..6aa77f23 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultEmptyCollectionViewCell.swift @@ -50,6 +50,6 @@ private extension SearchResultEmptyCollectionViewCell { extension SearchResultEmptyCollectionViewCell { func configureCell(title: String) { - self.emptyLabel.setText(to: title) + self.emptyLabel.updateText(to: title) } } diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift index ae344d92..40234e50 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift @@ -101,8 +101,8 @@ extension SearchResultHeaderCollectionViewCell { let count = count { filterStatusButton.isHidden = true afterSearchTitleLabel.isHidden = false - afterSearchTitleLabel.setText(to: afterSearchTitle + " 포함된 팝업") - cellCountLabel.setText(to: "총 \(count)개를 찾았어요.") + afterSearchTitleLabel.updateText(to: afterSearchTitle + " 포함된 팝업") + cellCountLabel.updateText(to: "총 \(count)개를 찾았어요.") if count == 0 { self.isHidden = true } else { self.isHidden = false @@ -114,8 +114,8 @@ extension SearchResultHeaderCollectionViewCell { } else if let count, let filterText { filterStatusButton.isHidden = false afterSearchTitleLabel.isHidden = true - cellCountLabel.setText(to: "총 \(count)개") - filterStatusLabel.setText(to: filterText) + cellCountLabel.updateText(to: "총 \(count)개") + filterStatusLabel.updateText(to: filterText) self.isHidden = false afterSearchTitleLabel.snp.updateConstraints { make in From 1be0a29a4399c2dbfa80c321b54b3ce7683ea44a Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 15:35:03 +0900 Subject: [PATCH 17/29] =?UTF-8?q?refactor/#161:=20UIButton=EC=97=90=20?= =?UTF-8?q?=ED=83=80=EC=9D=B4=ED=8F=AC=20=EC=8B=9C=EC=8A=A4=ED=85=9C?= =?UTF-8?q?=EC=9D=84=20=EB=B0=98=EC=98=81=ED=95=98=EB=8A=94=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Extension/UIButton+.swift | 26 +++++++++++++++ .../Component/TagCollectionHeaderView.swift | 32 +++++++++++-------- .../PopupSearch/View/PopupSearchView.swift | 2 +- 3 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIButton+.swift diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIButton+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIButton+.swift new file mode 100644 index 00000000..d97038a7 --- /dev/null +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UIButton+.swift @@ -0,0 +1,26 @@ +import UIKit + +public extension UIButton { + /// Style을 필요로하는 Text가 포함된 일반 버튼에서 사용 + func setText( + to text: String = " ", + with style: PPFontStyle, + for controlState: UIControl.State = .normal + ) { + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineHeightMultiple = style.lineHeightMultiple + paragraphStyle.maximumLineHeight = style.lineHeight + paragraphStyle.minimumLineHeight = style.lineHeight + + let attributedString = NSAttributedString( + string: text, + attributes: [ + .font: UIFont.PPFont(style: style), + .paragraphStyle: paragraphStyle, + .baselineOffset: style.baseLineOffset + ] + ) + + self.setAttributedTitle(attributedString, for: controlState) + } +} diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/Common/View/Component/TagCollectionHeaderView.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/Common/View/Component/TagCollectionHeaderView.swift index 99425b24..93f9c5d0 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/Common/View/Component/TagCollectionHeaderView.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/Common/View/Component/TagCollectionHeaderView.swift @@ -10,13 +10,15 @@ final class TagCollectionHeaderView: UICollectionReusableView { // MARK: - Components var disposeBag = DisposeBag() - private let sectionTitleLabel = UILabel().then { - $0.font = .korFont(style: .bold, size: 16) - } + private let sectionTitleLabel = PPLabel(text: "최근 검색어", style: .KOb16) let removeAllButton = UIButton().then { $0.isHidden = true + $0.setText(to: "모두삭제", with: .KOr13) + } + private let removeAllButtonUnderline = UIView().then { + $0.backgroundColor = .g1000 } // MARK: - init @@ -43,6 +45,10 @@ private extension TagCollectionHeaderView { [sectionTitleLabel, removeAllButton].forEach { self.addSubview($0) } + + [removeAllButtonUnderline].forEach { + removeAllButton.addSubview($0) + } } func setupConstraints() { @@ -57,20 +63,18 @@ private extension TagCollectionHeaderView { make.centerY.equalTo(sectionTitleLabel) make.height.equalTo(20) } + + removeAllButtonUnderline.snp.makeConstraints { make in + make.height.equalTo(1) + make.bottom.equalToSuperview() + make.horizontalEdges.equalToSuperview() + } } } extension TagCollectionHeaderView { - func configureHeader(title: String, buttonTitle: String? = nil) { - sectionTitleLabel.text = title - if let buttonTitle = buttonTitle { - removeAllButton.isHidden = false - let attributes: [NSAttributedString.Key: Any] = [ - .underlineStyle: NSUnderlineStyle.single.rawValue, - .font: UIFont.korFont(style: .regular, size: 13) - ] - let attributedTitle = NSAttributedString(string: buttonTitle, attributes: attributes) - removeAllButton.setAttributedTitle(attributedTitle, for: .normal) - } + func configureHeader(title: String, showRemoveAllButton: Bool = false) { + sectionTitleLabel.updateText(to: title) + removeAllButton.isHidden = !showRemoveAllButton } } diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/PopupSearchView.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/PopupSearchView.swift index bcd5b3e8..eb93baf7 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/PopupSearchView.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/PopupSearchView.swift @@ -234,7 +234,7 @@ extension PopupSearchView { withReuseIdentifier: TagCollectionHeaderView.identifiers, for: indexPath ) as? TagCollectionHeaderView else { fatalError("\(#file), \(#function) Error") } - header.configureHeader(title: "최근 검색어", buttonTitle: "모두삭제") + header.configureHeader(title: "최근 검색어", showRemoveAllButton: true) header.removeAllButton.rx.tap .bind(to: self.recentSearchTagRemoveAllButtonTapped) From 579f95fb134e89fee89e5ea64ef19e6f88bf0c35 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 16:31:31 +0900 Subject: [PATCH 18/29] =?UTF-8?q?docs/#161:=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20deprecated=20=EB=A9=94=EC=84=B8?= =?UTF-8?q?=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Components/PPLabel.swift | 1 + .../DesignSystem/DesignSystem/Extension/UILabel+.swift | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index 4fa25f67..7d07ef82 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -2,6 +2,7 @@ import UIKit public class PPLabel: UILabel { + @available(*, deprecated, renamed: "init(text:style:)",message: "타이포를 직접 지정하는 대신 PPFontStyle을 이용하세요") public init( style: UIFont.FontStyle = .regular, fontSize: CGFloat = 12, diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift index e2f2719a..5146bb22 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift @@ -1,6 +1,7 @@ import UIKit public extension UILabel { + @available(*, deprecated, message: "직접 속성을 넣는 방법 대신 타이포시스템을 이용하는 `updateText(to:)`또는 `setText(to:with:)`을 이용해주세요") func setLineHeightText(text: String?, font: UIFont?, lineHeight: CGFloat = 1.3) { guard let text = text, let font = font else { return } let paragraphStyle = NSMutableParagraphStyle() @@ -26,14 +27,14 @@ public extension UILabel { } /// Style이 포함된 텍스트를 적용합니다. - func setText(to text: String, with style: PPFontStyle) { + func setText(to text: String?, with style: PPFontStyle) { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineHeightMultiple = style.lineHeightMultiple paragraphStyle.maximumLineHeight = style.lineHeight paragraphStyle.minimumLineHeight = style.lineHeight self.attributedText = NSMutableAttributedString( - string: text, + string: text ?? " ", attributes: [ .font: UIFont.PPFont(style: style), .paragraphStyle: paragraphStyle, From 704d0a4215babce13bd6718c82b0072cd05892a9 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 17:04:43 +0900 Subject: [PATCH 19/29] =?UTF-8?q?fix/#161:=20=EC=98=81=EB=AC=B8=20?= =?UTF-8?q?=ED=8F=B0=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=88=98=EC=A7=81=20?= =?UTF-8?q?=EC=A4=91=EC=95=99=20=EC=A0=95=EB=A0=AC=EC=9D=B4=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8D=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Font/PPFontStyle.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift index 30ef5f93..4dff605c 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift @@ -1,4 +1,3 @@ - import Foundation import UIKit @@ -83,9 +82,13 @@ extension PPFontStyle { public var baseLineOffset: CGFloat { if #available(iOS 16.4, *) { - return (lineHeight - size) / 2 + return fontName.hasPrefix("Poppins") + ? (lineHeight - size + UIFont.PPFont(style: self).descender) / 2 + : (lineHeight - size) / 2 } else { - return (lineHeight - size) / 4 + return fontName.hasPrefix("Poppins") + ? (lineHeight - size + UIFont.PPFont(style: self).descender) / 4 + : (lineHeight - size) / 4 } } } From 8d2452ca637f4b0564f88269674e553b5bf5527b Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 17:22:03 +0900 Subject: [PATCH 20/29] =?UTF-8?q?refactor/#161:=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20=ED=83=80=EC=9D=B4=ED=8F=AC=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EC=A0=81=EC=9A=A9=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=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 --- .../Components/PPCancelHeaderView.swift | 3 +-- .../PPPopupGridCollectionViewCell.swift | 27 +++++++------------ .../DesignSystem/Extension/UILabel+.swift | 4 +-- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPCancelHeaderView.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPCancelHeaderView.swift index 777f79cf..155912c3 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPCancelHeaderView.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPCancelHeaderView.swift @@ -14,9 +14,8 @@ public final class PPCancelHeaderView: UIView { public let cancelButton: UIButton = { let button = UIButton(type: .system) - button.setTitle("취소", for: .normal) - button.titleLabel?.font = .korFont(style: .regular, size: 14) button.setTitleColor(.black, for: .normal) + button.setText(to: "취소", with: .KOr14, for: .normal) return button }() diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PopupGridCollectionViewCell/PPPopupGridCollectionViewCell.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PopupGridCollectionViewCell/PPPopupGridCollectionViewCell.swift index 0e8d1944..d74937ad 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PopupGridCollectionViewCell/PPPopupGridCollectionViewCell.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PopupGridCollectionViewCell/PPPopupGridCollectionViewCell.swift @@ -15,40 +15,35 @@ public final class PPPopupGridCollectionViewCell: UICollectionViewCell { $0.contentMode = .scaleAspectFill } - private let categoryLabel = PPLabel(style: .bold, fontSize: 11).then { + private let categoryLabel = PPLabel(style: .KOb11).then { $0.textColor = .blu500 - $0.setLineHeightText(text: "category", font: .korFont(style: .bold, size: 11)) } - private let titleLabel = PPLabel(style: .bold, fontSize: 14).then { + private let titleLabel = PPLabel(style: .KOb14).then { $0.numberOfLines = 2 $0.lineBreakMode = .byTruncatingTail - $0.setLineHeightText(text: "title", font: .korFont(style: .bold, size: 14)) } - private let addressLabel = PPLabel(style: .medium, fontSize: 11).then { + private let addressLabel = PPLabel(style: .KOm11).then { $0.numberOfLines = 1 $0.lineBreakMode = .byTruncatingTail $0.textColor = .g400 - $0.setLineHeightText(text: "address", font: .korFont(style: .medium, size: 11)) } - private let dateLabel = PPLabel(style: .medium, fontSize: 11).then { + private let dateLabel = PPLabel(style: .ENr11).then { $0.lineBreakMode = .byTruncatingTail $0.textColor = .g400 - $0.setLineHeightText(text: "date", font: .korFont(style: .medium, size: 11)) } public let bookmarkButton = UIButton() - private let rankLabel = UILabel().then { + private let rankLabel = PPLabel(style: .KOm11).then { $0.backgroundColor = .w10 $0.layer.cornerRadius = 12 $0.clipsToBounds = true $0.isHidden = true $0.textColor = .w100 $0.textAlignment = .center - $0.setLineHeightText(text: "rank", font: .korFont(style: .medium, size: 11), lineHeight: 1) } // MARK: - init @@ -103,14 +98,12 @@ private extension PPPopupGridCollectionViewCell { dateLabel.snp.makeConstraints { make in make.leading.equalToSuperview() - make.height.equalTo(15).priority(.high) make.bottom.equalToSuperview() } addressLabel.snp.makeConstraints { make in make.leading.trailing.equalToSuperview() make.bottom.equalTo(dateLabel.snp.top) - make.height.equalTo(17).priority(.high) } bookmarkButton.snp.makeConstraints { make in @@ -137,12 +130,12 @@ private extension PPPopupGridCollectionViewCell { extension PPPopupGridCollectionViewCell { public func configureCell(imagePath: String?, id: Int64, category: String?, title: String?, address: String?, startDate: String?, endDate: String?, isBookmark: Bool, isLogin: Bool, isPopular: Bool = false, row: Int?) { - categoryLabel.text = "#" + (category ?? "") - titleLabel.text = title - addressLabel.text = address + categoryLabel.updateText(to: "#" + (category ?? "")) + titleLabel.updateText(to: title) + addressLabel.updateText(to: address) let date = startDate.toDate().toPPDateString() + " ~ " + endDate.toDate().toPPDateString() - dateLabel.text = date + dateLabel.updateText(to: date) let bookmarkImage = isBookmark ? UIImage(named: "icon_bookmark_fill") : UIImage(named: "icon_bookmark") bookmarkButton.setImage(bookmarkImage, for: .normal) @@ -153,7 +146,7 @@ extension PPPopupGridCollectionViewCell { rankLabel.isHidden = !isPopular if let rank = row { - rankLabel.text = "\(rank)" + rankLabel.updateText(to: "\(rank)") rankLabel.isHidden = rank > 2 } } diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift index 5146bb22..6e9f2ec5 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift @@ -17,13 +17,13 @@ public extension UILabel { } /// 기존 attributedText 속성을 유지하며 텍스트만 교체합니다. - func updateText(to text: String) { + func updateText(to text: String?) { guard let current = self.attributedText, current.length > 0 else { self.text = text return } let attributes = current.attributes(at: 0, effectiveRange: nil) - self.attributedText = NSAttributedString(string: text, attributes: attributes) + self.attributedText = NSAttributedString(string: text ?? " ", attributes: attributes) } /// Style이 포함된 텍스트를 적용합니다. From ea2292b71ee322c3231dfaed0f8512629489f28d Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 17:22:15 +0900 Subject: [PATCH 21/29] =?UTF-8?q?docs/#161:=20=EC=B6=94=ED=9B=84=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=ED=95=B4=EC=95=BC=EB=90=A0=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PPTagCollectionViewCell/PPTagCollectionViewCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift index 304d3456..0f3948e0 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift @@ -83,6 +83,7 @@ private extension PPTagCollectionViewCell { } } +// FIXME: Chip 컴포넌트화 및 분기적용 필요 (디자인 시스템 도입 필요) extension PPTagCollectionViewCell { public func configureCell(title: String? = nil, id: Int?, isSelected: Bool = false, isCancelable: Bool = true, fontSize: CGFloat = 11, cornerRadius: CGFloat = 15.5) { let xmarkImage = isSelected ? UIImage(named: "icon_xmark_white") : UIImage(named: "icon_xmark_gray") From 8b32702942f77a505f2fdf3746cc7f5452161c8d Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 17:28:37 +0900 Subject: [PATCH 22/29] =?UTF-8?q?docs/#161:=20deprecated=20=EB=A9=94?= =?UTF-8?q?=EC=84=B8=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/DesignSystem/Extension/UITextField+.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift index 2054df2b..4ae0cab5 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UITextField+.swift @@ -1,6 +1,7 @@ import UIKit public extension UITextField { + @available(*, deprecated, message: "직접 속성을 넣는 방법 대신 타이포시스템을 이용하는 `setPlaceholder(text:color:style:)`을 이용해주세요") func setPlaceholder(text: String, color: UIColor, font: UIFont) { self.attributedPlaceholder = NSAttributedString( string: text, From eee3a2635a02c2d0a6ec2b02ce19bc89edc641cd Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 18:03:25 +0900 Subject: [PATCH 23/29] =?UTF-8?q?refactor/#161:=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20=ED=83=80=EC=9D=B4=ED=8F=AC=20=EA=B8=B0=EB=B0=98=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=EC=99=80=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PPTagCollectionViewCell.swift | 2 +- .../LoginFeature/Login/LastLoginView.swift | 28 ++++++++++--------- .../LoginFeature/Login/LoginView.swift | 13 ++++----- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift index 0f3948e0..dff383ca 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPTagCollectionViewCell/PPTagCollectionViewCell.swift @@ -9,7 +9,7 @@ public final class PPTagCollectionViewCell: UICollectionViewCell { public var disposeBag = DisposeBag() - public let titleLabel = PPLabel(style: .medium, fontSize: 11) + public let titleLabel = PPLabel(style: .KOm11) public let cancelButton = UIButton() diff --git a/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LastLoginView.swift b/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LastLoginView.swift index 7a43ada4..5c5e61d0 100644 --- a/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LastLoginView.swift +++ b/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LastLoginView.swift @@ -1,5 +1,6 @@ import UIKit +import DesignSystem import SnapKit final class LastLoginView: UIView { @@ -37,11 +38,10 @@ final class LastLoginView: UIView { return UIView() }() - private let notificationLabel: UILabel = { - let label = UILabel() - label.font = .korFont(style: .medium, size: 13) - return label - }() + private let notificationLabel = PPLabel( + text: "최근에 이 방법으로 로그인했어요", + style: .KOm13 + ) private var colorType: TipColor { didSet { @@ -61,13 +61,13 @@ final class LastLoginView: UIView { /// - Parameters: /// - colorType: 툴팁의 색상(UIColor)을 인자로 받습니다 - w100, blu500 /// - direction: 툴팁의 방향을 인자로 받습니다 - up / down - init(colorType: TipColor, direction: TipDirection, text: String?) { + init(colorType: TipColor, direction: TipDirection) { self.colorType = colorType self.direction = direction super.init(frame: .zero) + setupLayer(color: colorType) notificationLabel.textColor = colorType.textColor - notificationLabel.text = text } required init?(coder: NSCoder) { @@ -97,13 +97,13 @@ extension LastLoginView { case .pointUp: notificationLabel.snp.makeConstraints { make in make.leading.trailing.equalToSuperview().inset(16) - make.bottom.equalToSuperview().inset(11) + make.bottom.equalToSuperview().inset(8) } case .pointDown: notificationLabel.snp.makeConstraints { make in - make.leading.trailing.equalToSuperview().inset(16) - make.top.equalToSuperview().inset(11) + make.horizontalEdges.equalToSuperview().inset(16) + make.top.equalToSuperview().inset(8) } } } @@ -191,13 +191,15 @@ extension LastLoginView { extension UIView { func showToolTip( color: LastLoginView.TipColor, - direction: LastLoginView.TipDirection, - text: String? = "최근에 이 방법으로 로그인했어요" + direction: LastLoginView.TipDirection ) { // 호출하는 컴포넌트 위 또는 아래에 생성되기 위해 superview를 구합니다 guard let superview = self.superview else { return } - let toolTip = LastLoginView(colorType: color, direction: direction, text: text) + let toolTip = LastLoginView( + colorType: color, + direction: direction + ) let beforeToolTip = superview.subviews.filter { $0 is LastLoginView } beforeToolTip.forEach { $0.removeFromSuperview() } diff --git a/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LoginView.swift b/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LoginView.swift index e24e2273..8d124c88 100644 --- a/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LoginView.swift +++ b/Poppool/PresentationLayer/LoginFeature/LoginFeature/Login/LoginView.swift @@ -27,7 +27,10 @@ final class LoginView: UIView { $0.contentMode = .scaleAspectFit } - let titleLabel = PPLabel() + let titleLabel = PPLabel(style: .KOb16).then { + $0.textAlignment = .center + $0.numberOfLines = 0 + } let kakaoButton = PPButton(style: .kakao, text: "카카오톡으로 로그인") @@ -138,13 +141,7 @@ private extension LoginView { extension LoginView { func setTitle(_ title: String) { - self.titleLabel.setLineHeightText( - text: title, - font: .korFont(style: .bold, size: 16), - lineHeight: 1.3 - ) - self.titleLabel.numberOfLines = 0 - self.titleLabel.textAlignment = .center + self.titleLabel.updateText(to: title) } func setCloseButton(for loginSceneType: LoginSceneType) { From 6580881dcc998231c7e4c63d77acafd03bd450b4 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 18:37:59 +0900 Subject: [PATCH 24/29] =?UTF-8?q?feat/#161:=20=ED=95=9C=EA=B8=80=20?= =?UTF-8?q?=ED=8C=90=EB=8F=85=20extension=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Infrastructure/Infrastructure/Extension/String+.swift | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Poppool/CoreLayer/Infrastructure/Infrastructure/Extension/String+.swift diff --git a/Poppool/CoreLayer/Infrastructure/Infrastructure/Extension/String+.swift b/Poppool/CoreLayer/Infrastructure/Infrastructure/Extension/String+.swift new file mode 100644 index 00000000..fb7c74e2 --- /dev/null +++ b/Poppool/CoreLayer/Infrastructure/Infrastructure/Extension/String+.swift @@ -0,0 +1,7 @@ +import Foundation + +public extension String { + var isHangul: Bool { + return "\(self)".range(of: "\\p{Hangul}", options: .regularExpression) != nil + } +} From a88ba409590115d1837a87960c9e5dd5e1675dc3 Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 18:38:28 +0900 Subject: [PATCH 25/29] =?UTF-8?q?refactor/#161:=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=EB=93=A4=EC=9D=84=20=EC=83=88?= =?UTF-8?q?=EB=A1=9C=EC=9A=B4=20=EB=A9=94=EC=84=9C=EB=93=9C=EC=97=90=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=82=B4?= =?UTF-8?q?=EB=B6=80=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Components/PPLabel.swift | 47 ++++++++++++++---- .../DesignSystem/Extension/UILabel+.swift | 49 +++++++++++++++---- .../DesignSystem/Font/PPFontStyle.swift | 2 +- 3 files changed, 78 insertions(+), 20 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index 7d07ef82..bd5f05fc 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -2,21 +2,29 @@ import UIKit public class PPLabel: UILabel { - @available(*, deprecated, renamed: "init(text:style:)",message: "타이포를 직접 지정하는 대신 PPFontStyle을 이용하세요") + @available(*, deprecated, renamed: "init(text:style:)", message: "타이포를 직접 지정하는 대신 PPFontStyle을 이용하세요") public init( style: UIFont.FontStyle = .regular, fontSize: CGFloat = 12, - text: String = "", + text: String = " ", lineHeight: CGFloat = 1.2 ) { super.init(frame: .zero) - self.font = .korFont(style: style, size: fontSize) - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineHeightMultiple = lineHeight - self.attributedText = NSMutableAttributedString( - string: text, - attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle] - ) +// self.font = .korFont(style: style, size: fontSize) +// let paragraphStyle = NSMutableParagraphStyle() +// paragraphStyle.lineHeightMultiple = lineHeight +// self.attributedText = NSMutableAttributedString( +// string: text, +// attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle] +// ) + + guard let parseResult = parseToPPFontStyle( + style: style, + fontSize: fontSize, + text: text + ) else { return } + + self.setText(to: text, with: PPFontStyle(rawValue: parseResult) ?? .KOb32) } public init( @@ -31,3 +39,24 @@ public class PPLabel: UILabel { fatalError("init(coder:) has not been implemented") } } + +private extension PPLabel { + func parseToPPFontStyle( + style: UIFont.FontStyle, + fontSize: CGFloat, + text: String + ) -> String? { + var result = text.isHangul ? "KO" : "EN" + + switch style { + case .bold: result.append("b") + case .medium: result.append("m") + case .regular: result.append("r") + case .light: result.append("l") + } + + result.append("\(Int(font.pointSize))") + + return result + } +} diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift index 6e9f2ec5..e30c16b7 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Extension/UILabel+.swift @@ -4,16 +4,21 @@ public extension UILabel { @available(*, deprecated, message: "직접 속성을 넣는 방법 대신 타이포시스템을 이용하는 `updateText(to:)`또는 `setText(to:with:)`을 이용해주세요") func setLineHeightText(text: String?, font: UIFont?, lineHeight: CGFloat = 1.3) { guard let text = text, let font = font else { return } - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineBreakMode = .byTruncatingTail - paragraphStyle.lineHeightMultiple = lineHeight - self.attributedText = NSMutableAttributedString( - string: text, - attributes: [ - .paragraphStyle: paragraphStyle, - .font: font - ] - ) + + guard let parseResult = parseToPPFontStyle(text: text, font: font) else { return } + + self.setText(to: text, with: PPFontStyle(rawValue: parseResult) ?? .KOb32) +// +// let paragraphStyle = NSMutableParagraphStyle() +// paragraphStyle.lineBreakMode = .byTruncatingTail +// paragraphStyle.lineHeightMultiple = lineHeight +// self.attributedText = NSMutableAttributedString( +// string: text, +// attributes: [ +// .paragraphStyle: paragraphStyle, +// .font: font +// ] +// ) } /// 기존 attributedText 속성을 유지하며 텍스트만 교체합니다. @@ -29,6 +34,7 @@ public extension UILabel { /// Style이 포함된 텍스트를 적용합니다. func setText(to text: String?, with style: PPFontStyle) { let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineBreakMode = .byTruncatingTail paragraphStyle.lineHeightMultiple = style.lineHeightMultiple paragraphStyle.maximumLineHeight = style.lineHeight paragraphStyle.minimumLineHeight = style.lineHeight @@ -43,3 +49,26 @@ public extension UILabel { ) } } + +private extension UILabel { + func parseToPPFontStyle(text: String?, font: UIFont?) -> String? { + guard let font = font else { return nil } + + var result = "" + + let splitResult = font.fontName.split(separator: "-") + splitResult[0] == "Poppins" ? result.append("EN") : result.append("KO") + + switch splitResult[1] { + case "Light": result.append("l") + case "Regular": result.append("r") + case "Medium": result.append("m") + case "Bold": result.append("b") + default: return nil + } + + result.append("\(Int(font.pointSize))") + + return result + } +} diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift index 4dff605c..ab62e0b2 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Font/PPFontStyle.swift @@ -2,7 +2,7 @@ import Foundation import UIKit // MARK: - Font cases -public enum PPFontStyle { +public enum PPFontStyle: String { // 한국어 Typeface Guide case KOl32, KOl28, KOl24, KOl20, KOl18, KOl16, KOl15, KOl14, KOl13, KOl12, KOl11 case KOr32, KOr28, KOr24, KOr20, KOr18, KOr16, KOr15, KOr14, KOr13, KOr12, KOr11 From 58085a983dfe180736e4e76373bff362e797cc1e Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 19:06:55 +0900 Subject: [PATCH 26/29] =?UTF-8?q?refactor/#161:=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20=ED=83=80=EC=9D=B4=ED=8F=AC=20=EB=B0=A9=EC=8B=9D=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommentCheck/CommentCheckView.swift | 14 +++--- .../Scene/Home/Main/View/HomeHeaderView.swift | 14 +++--- .../HomePopularCardSectionCell.swift | 43 ++++++++----------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift index 610435fd..0047bc22 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift @@ -3,19 +3,21 @@ import UIKit import DesignSystem import SnapKit +import Then final class CommentCheckView: UIView { // MARK: - Components private let titleLabel: PPLabel = { - return PPLabel(style: .bold, fontSize: 18, text: "코멘트 작성을 그만하시겠어요?") + return PPLabel(text: "코멘트 작성을 그만하시겠어요?", style: .KOb18) }() - private let descriptionLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 14, text: "화면을 나가실 경우 작성중인 내용은 저장되지 않아요.") - label.textColor = .g600 - return label - }() + private let descriptionLabel = PPLabel( + text: "화면을 나가실 경우 작성중인 내용은 저장되지 않아요.", + style: .KOr14 + ).then { + $0.textColor = .g600 + } private let buttonStackView: UIStackView = { let view = UIStackView() diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomeHeaderView.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomeHeaderView.swift index 28dac37a..ee7b10ff 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomeHeaderView.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomeHeaderView.swift @@ -3,6 +3,7 @@ import UIKit import DesignSystem import SnapKit +import Then final class HomeHeaderView: UIView { @@ -23,12 +24,13 @@ final class HomeHeaderView: UIView { return view }() - private let searchLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 14, text: "팝업스토어명을 입력해보세요") - label.textColor = .g1000 - label.isUserInteractionEnabled = false - return label - }() + private let searchLabel = PPLabel( + text: "팝업스토어명을 입력해보세요", + style: .KOr14 + ).then { + $0.textColor = .g1000 + $0.isUserInteractionEnabled = false + } // MARK: - init init() { diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomePopularCardSection/HomePopularCardSectionCell.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomePopularCardSection/HomePopularCardSectionCell.swift index a7f8816f..8be51fa5 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomePopularCardSection/HomePopularCardSectionCell.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Home/Main/View/HomePopularCardSection/HomePopularCardSectionCell.swift @@ -31,31 +31,23 @@ final class HomePopularCardSectionCell: UICollectionViewCell { return view }() - private let dateLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 16) - label.textColor = .w100 - return label - }() + private let dateLabel = PPLabel(style: .KOr16).then { + $0.textColor = .w100 + } - private let categoryLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 16) - label.textColor = .g1000 - label.backgroundColor = .w100 - return label - }() + private let categoryLabel = PPLabel(style: .KOr16).then { + $0.textColor = .g1000 + $0.backgroundColor = .w100 + } - private let titleLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 16) - label.numberOfLines = 2 - label.textColor = .w100 - return label - }() + private let titleLabel = PPLabel(style: .KOr16).then { + $0.numberOfLines = 2 + $0.textColor = .w100 + } - private let locationLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 16) - label.textColor = .w100 - return label - }() + private let locationLabel = PPLabel(style: .KOr16).then { + $0.textColor = .w100 + } let disposeBag = DisposeBag() @@ -127,7 +119,8 @@ extension HomePopularCardSectionCell: Inputable { func injection(with input: Input) { let date = "#\(input.endDate.toDate().toPPDateMonthString())까지 열리는" - dateLabel.setLineHeightText(text: date, font: .korFont(style: .regular, size: 16)) + dateLabel.updateText(to: date) + let category = "#\(input.category ?? "")" if let addressArray = input.address?.components(separatedBy: " ") { if addressArray.count > 2 { @@ -136,8 +129,8 @@ extension HomePopularCardSectionCell: Inputable { } } - categoryLabel.text = category - titleLabel.setLineHeightText(text: input.title, font: .korFont(style: .regular, size: 16)) + categoryLabel.updateText(to: category) + titleLabel.updateText(to: input.title) backGroundImageView.setPPImage(path: input.imagePath) } } From a3b44d8893fa733d8597955472f0fe4828c191ed Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Mon, 28 Jul 2025 19:18:31 +0900 Subject: [PATCH 27/29] =?UTF-8?q?feat/#161:=20PPButton=EC=9D=98=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EC=9A=B4=20=EC=83=9D=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EA=B8=B0=EC=A1=B4=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EC=9E=90=20=EB=B3=80=EA=B2=BD=EB=90=9C=20=ED=83=80?= =?UTF-8?q?=EC=9D=B4=ED=8F=AC=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Components/PPButton.swift | 60 ++++++++++++++++++- .../DesignSystem/Components/PPLabel.swift | 2 +- .../CommentCheck/CommentCheckView.swift | 4 +- .../CommentDetailContentSectionCell.swift | 11 ++-- .../Map/StoreListView/StoreListCell.swift | 1 - 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPButton.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPButton.swift index c4e2a4cd..67151e7a 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPButton.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPButton.swift @@ -1,5 +1,7 @@ import UIKit +import Infrastructure + public class PPButton: UIButton { public enum ButtonStyle { @@ -62,6 +64,29 @@ public class PPButton: UIButton { } } + public init( + buttonStyle: ButtonStyle, + fontStyle: PPFontStyle = .KOm16, + text: String, + disabledText: String = " ", + cornerRadius: CGFloat = 4 + ) { + super.init(frame: .zero) + + self.setTitleColor(buttonStyle.textColor, for: .normal) + self.setTitleColor(buttonStyle.disabledTextColor, for: .disabled) + + self.setBackgroundColor(buttonStyle.backgroundColor, for: .normal) + self.setBackgroundColor(buttonStyle.disabledBackgroundColor, for: .disabled) + + self.setText(to: text, with: fontStyle, for: .normal) + self.setText(to: disabledText, with: fontStyle, for: .disabled) + + self.layer.cornerRadius = cornerRadius + self.clipsToBounds = true + } + + @available(*, deprecated, message: "PPFontStyle로 파싱하는 init을 사용해주세요.") public init( style: ButtonStyle, text: String, @@ -71,8 +96,12 @@ public class PPButton: UIButton { ) { super.init(frame: .zero) - self.setTitle(text, for: .normal) - self.setTitle(disabledText, for: .disabled) + guard let parseResult = parseToPPFontStyle(text: text, font: font), + let PPFontStyle = PPFontStyle(rawValue: parseResult) + else { + Logger.log("PPFontStyle로 파싱할 수 없는 폰트입니다.", category: .error) + return + } self.setTitleColor(style.textColor, for: .normal) self.setTitleColor(style.disabledTextColor, for: .disabled) @@ -80,7 +109,9 @@ public class PPButton: UIButton { self.setBackgroundColor(style.backgroundColor, for: .normal) self.setBackgroundColor(style.disabledBackgroundColor, for: .disabled) - self.titleLabel?.font = font + self.setText(to: text, with: PPFontStyle, for: .normal) + self.setText(to: disabledText, with: PPFontStyle, for: .disabled) + self.layer.cornerRadius = cornerRadius self.clipsToBounds = true } @@ -105,3 +136,26 @@ public class PPButton: UIButton { self.setBackgroundImage(backgroundImage, for: state) } } + +private extension PPButton { + func parseToPPFontStyle(text: String?, font: UIFont?) -> String? { + guard let font = font else { return nil } + + var result = "" + + let splitResult = font.fontName.split(separator: "-") + splitResult[0] == "Poppins" ? result.append("EN") : result.append("KO") + + switch splitResult[1] { + case "Light": result.append("l") + case "Regular": result.append("r") + case "Medium": result.append("m") + case "Bold": result.append("b") + default: return nil + } + + result.append("\(Int(font.pointSize))") + + return result + } +} diff --git a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift index bd5f05fc..1cd495d1 100644 --- a/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift +++ b/Poppool/PresentationLayer/DesignSystem/DesignSystem/Components/PPLabel.swift @@ -55,7 +55,7 @@ private extension PPLabel { case .light: result.append("l") } - result.append("\(Int(font.pointSize))") + result.append("\(Int(fontSize))") return result } diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift index 0047bc22..6cb2fbae 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentCheck/CommentCheckView.swift @@ -27,11 +27,11 @@ final class CommentCheckView: UIView { }() let continueButton: PPButton = { - return PPButton(style: .secondary, text: "계속하기") + return PPButton(buttonStyle: .secondary, text: "계속하기") }() let stopButton: PPButton = { - return PPButton(style: .primary, text: "그만하기") + return PPButton(buttonStyle: .primary, text: "그만하기") }() // MARK: - init diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentDetail/View/CommentDetailContentSection/CommentDetailContentSectionCell.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentDetail/View/CommentDetailContentSection/CommentDetailContentSectionCell.swift index 96bea9e7..00d8ff5c 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentDetail/View/CommentDetailContentSection/CommentDetailContentSectionCell.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Comment/CommentDetail/View/CommentDetailContentSection/CommentDetailContentSectionCell.swift @@ -4,16 +4,15 @@ import DesignSystem import RxSwift import SnapKit +import Then final class CommentDetailContentSectionCell: UICollectionViewCell { // MARK: - Components - private let contentLabel: PPLabel = { - let label = PPLabel(style: .medium, fontSize: 13) - label.numberOfLines = 0 - return label - }() + private let contentLabel = PPLabel(style: .KOm13).then { + $0.numberOfLines = 0 + } let disposeBag = DisposeBag() // MARK: - init @@ -44,6 +43,6 @@ extension CommentDetailContentSectionCell: Inputable { } func injection(with input: Input) { - contentLabel.setLineHeightText(text: input.content, font: .korFont(style: .medium, size: 13)) + contentLabel.updateText(to: input.content) } } diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift index bdfb71b8..02096423 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift @@ -145,5 +145,4 @@ extension StoreListCell: Inputable { let bookmarkImage = input.isBookmarked ? "icon_bookmark_fill" : "icon_bookmark" bookmarkButton.setImage(UIImage(named: bookmarkImage), for: .normal) } - } From 52948f845668e48c235ac04b9da76ad7058ae40a Mon Sep 17 00:00:00 2001 From: 0Hooni Date: Tue, 29 Jul 2025 13:23:52 +0900 Subject: [PATCH 28/29] =?UTF-8?q?refactor/#161:=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20=ED=83=80=EC=9D=B4=ED=8F=AC=20=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EC=A0=81=EC=9A=A9=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=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 --- .../Map/FillterSheetView/FilterChip.swift | 4 +- .../FillterSheetView/FilterChipsView.swift | 23 +++------ .../Map/StoreListView/StoreListCell.swift | 49 ++++++++----------- 3 files changed, 31 insertions(+), 45 deletions(-) diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChip.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChip.swift index ec0fa088..a030bc0d 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChip.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChip.swift @@ -46,8 +46,6 @@ final class FilterChip: UIButton { // MARK: - Configuration func setTitle(_ title: String, style: Style) { - setTitle(title, for: .normal) - titleLabel?.font = .systemFont(ofSize: 14, weight: .bold) switch style { case .inactive: @@ -73,6 +71,8 @@ final class FilterChip: UIButton { let rightPadding: CGFloat = closeButton.isHidden ? 12 : 34 contentEdgeInsets = UIEdgeInsets(top: 5, left: 12, bottom: 7, right: rightPadding) + + self.setText(to: title, with: .KOb14, for: .normal) } // MARK: - Actions diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChipsView.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChipsView.swift index 03c81149..4addedff 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChipsView.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/FillterSheetView/FilterChipsView.swift @@ -7,12 +7,9 @@ import SnapKit final class FilterChipsView: UIView { // MARK: - Components var onRemoveChip: ((String) -> Void)? - private let titleLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 13) - label.text = "선택한 옵션" - label.textColor = .g200 - return label - }() + private let titleLabel = PPLabel(text: "선택한 옵션", style: .KOr13).then { + $0.textColor = .g200 + } private lazy var collectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() @@ -28,15 +25,11 @@ final class FilterChipsView: UIView { return collectionView }() - private let emptyStateLabel: UILabel = { - let label = UILabel() - label.text = "선택한 옵션이 없어요 :)" - label.textColor = .g300 - label.font = UIFont.systemFont(ofSize: 14, weight: .medium) - label.textAlignment = .center - label.isHidden = true // 초기에는 숨김 상태 - return label - }() + private let emptyStateLabel = PPLabel(text: "선택한 옵션이 없어요 :)", style: .KOm14).then { + $0.textColor = .g300 + $0.textAlignment = .center + $0.isHidden = true // 초기에는 숨김 상태 + } private var filters: [String] = [] diff --git a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift index 02096423..634ef367 100644 --- a/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift +++ b/Poppool/PresentationLayer/Presentation/Presentation/Scene/Map/StoreListView/StoreListCell.swift @@ -5,6 +5,7 @@ import DesignSystem import ReactorKit import RxSwift import SnapKit +import Then final class StoreListCell: UICollectionViewCell { static let identifier = "StoreListCell" @@ -27,39 +28,31 @@ final class StoreListCell: UICollectionViewCell { return button }() - private let categoryTagLabel: PPLabel = { - let label = PPLabel(style: .bold, fontSize: 11, text: "") - label.textColor = .blu500 - label.text = "#카테고리" - return label - }() + private let categoryTagLabel = PPLabel(style: .KOb11).then { + $0.textColor = .blu500 + } - private let titleLabel: PPLabel = { - let label = PPLabel(style: .bold, fontSize: 14, text: "") - label.textColor = .g900 - label.numberOfLines = 2 - return label - }() + private let titleLabel = PPLabel(style: .KOb14).then { + $0.textColor = .g900 + $0.numberOfLines = 2 + } - private let locationLabel: PPLabel = { - let label = PPLabel(style: .medium, fontSize: 11, text: "") - label.textColor = .g400 - label.numberOfLines = 2 - return label - }() + private let locationLabel = PPLabel(style: .KOm11).then { + $0.textColor = .g400 + $0.numberOfLines = 2 + } - private let dateLabel: PPLabel = { - let label = PPLabel(style: .regular, fontSize: 12, text: "") - label.textColor = .g400 - label.numberOfLines = 2 - return label - }() + private let dateLabel = PPLabel(style: .KOr12).then { + $0.textColor = .g400 + $0.numberOfLines = 2 + } var disposeBag = DisposeBag() // MARK: - Init override init(frame: CGRect) { super.init(frame: frame) + setUpConstraints() configureUI() } @@ -137,10 +130,10 @@ extension StoreListCell: Inputable { func injection(with input: Input) { thumbnailImageView.setPPImage(path: input.thumbnailURL) - categoryTagLabel.text = "#\(input.category)" - titleLabel.text = input.title - locationLabel.text = input.location - dateLabel.text = input.date + categoryTagLabel.updateText(to: "#\(input.category)") + titleLabel.updateText(to: input.title) + locationLabel.updateText(to: input.location) + dateLabel.updateText(to: input.date) let bookmarkImage = input.isBookmarked ? "icon_bookmark_fill" : "icon_bookmark" bookmarkButton.setImage(UIImage(named: bookmarkImage), for: .normal) From bde6ab1fb44d30f8b5392aaf56a4c42e61388357 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 29 Jul 2025 05:54:02 +0000 Subject: [PATCH 29/29] style/#161: Apply SwiftLint autocorrect --- .../Component/Cell/SearchResultHeaderCollectionViewCell.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift index 40234e50..dfc96e35 100644 --- a/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift +++ b/Poppool/PresentationLayer/SearchFeature/SearchFeature/PopupSearch/View/Component/Cell/SearchResultHeaderCollectionViewCell.swift @@ -12,7 +12,6 @@ public final class SearchResultHeaderCollectionViewCell: UICollectionViewCell { var disposeBag = DisposeBag() - private let afterSearchTitleLabel = PPLabel(style: .KOb16).then { $0.isHidden = true }