From 99db054e7f44e1be9f6e9a1eff365fbfeecedb88 Mon Sep 17 00:00:00 2001 From: youn9k Date: Tue, 28 Nov 2023 21:00:07 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=ED=8B=80=EB=A6=B0=20=EC=A0=95=EB=B3=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UsertInterfaces/DesignSystem/Sources/WMFontSystem.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/WMFontSystem.swift b/Projects/UsertInterfaces/DesignSystem/Sources/WMFontSystem.swift index 90a119202..1d37a7b98 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/WMFontSystem.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/WMFontSystem.swift @@ -25,7 +25,7 @@ public extension UIFont { case t4(weight: WMFontWeight = .medium) /// size: 16 height: 24 case t5(weight: WMFontWeight = .medium) - /// size: 14 height: 14 + /// size: 14 height: 24 case t6(weight: WMFontWeight = .medium) /// size: 14 height: 20 case t6_1(weight: WMFontWeight = .medium) From 9eaabc4a98dfb0b8518f63617c8fe255d8cbb6f2 Mon Sep 17 00:00:00 2001 From: youn9k Date: Tue, 28 Nov 2023 21:00:35 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20WMFlowLabel=20ini?= =?UTF-8?q?t=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignSystem/Sources/WMFlowLabel.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/WMFlowLabel.swift b/Projects/UsertInterfaces/DesignSystem/Sources/WMFlowLabel.swift index 5aecc59cb..17542f3a5 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/WMFlowLabel.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/WMFlowLabel.swift @@ -36,6 +36,22 @@ public final class WMFlowLabel: MarqueeLabel { self.animationDelay = animationDelay } + convenience init( + text: String, + textColor: UIColor = .init(), + font: UIFont.WMFontSystem, + alignment: NSTextAlignment = .left, + lineHeight: CGFloat? = nil, + kernValue: Double? = nil, + leadingBuffer: CGFloat = 0, + trailingBuffer: CGFloat = 0, + animationDelay: CGFloat = 1, + animationSpeed: CGFloat = 30, + fadeLength: CGFloat = 3 + ) { + self.init(text: text, textColor: textColor, font: font, alignment: alignment, lineHeight: lineHeight, kernValue: kernValue, lineSpacing: nil, lineHeightMultiple: nil, leadingBuffer: leadingBuffer, trailingBuffer: trailingBuffer, animationDelay: animationDelay, animationSpeed: animationSpeed, fadeLength: fadeLength) + } + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } From ea77eeb9d11339f2a5b00b7fc6b702a4f63dd312 Mon Sep 17 00:00:00 2001 From: youn9k Date: Tue, 28 Nov 2023 21:24:32 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20PlayerFeature=20W?= =?UTF-8?q?MLabel=20&=20WMFlowLabel=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Views/MiniPlayerView.swift | 28 ++--------------- .../Sources/Views/PlayerView.swift | 31 +++---------------- .../Sources/Views/PlaylistTableViewCell.swift | 15 ++------- .../Sources/Views/PlaylistView.swift | 18 ++--------- 4 files changed, 11 insertions(+), 81 deletions(-) diff --git a/Projects/Features/PlayerFeature/Sources/Views/MiniPlayerView.swift b/Projects/Features/PlayerFeature/Sources/Views/MiniPlayerView.swift index 83075a43f..bf13fbf58 100644 --- a/Projects/Features/PlayerFeature/Sources/Views/MiniPlayerView.swift +++ b/Projects/Features/PlayerFeature/Sources/Views/MiniPlayerView.swift @@ -38,31 +38,9 @@ final class MiniPlayerView: UIView { $0.distribution = .fill } - lazy var titleLabel = WMFlow - - internal lazy var titleLabel = MarqueeLabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.medium, size: 14) - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.text = "제목" - $0.setTextWithAttributes(lineHeight: 24, kernValue: -0.5) - $0.leadingBuffer = 0 - $0.trailingBuffer = 35 - $0.fadeLength = 3 - $0.animationDelay = 1 - $0.speed = .rate(30) - } - - internal lazy var artistLabel = MarqueeLabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.light, size: 12) - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.text = "아티스트" - $0.setTextWithAttributes(lineHeight: 18, kernValue: -0.5) - $0.leadingBuffer = 0 - $0.trailingBuffer = 20 - $0.fadeLength = 3 - $0.animationDelay = 1 - $0.speed = .rate(30) - } + lazy var titleLabel = WMFlowLabel(text: "제목", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t6(weight: .medium), alignment: .left, lineHeight: UIFont.WMFontSystem.t6().lineHeight, kernValue: -0.5, leadingBuffer: 0, trailingBuffer: 35, animationDelay: 1, animationSpeed: 30, fadeLength: 3) + + lazy var artistLabel = WMFlowLabel(text: "아티스트", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t7(weight: .light), alignment: .left, lineHeight: UIFont.WMFontSystem.t6().lineHeight, kernValue: -0.5, leadingBuffer: 0, trailingBuffer: 20, animationDelay: 1, animationSpeed: 30, fadeLength: 3) internal lazy var playButton = UIButton().then { $0.setImage(DesignSystemAsset.Player.miniPlay.image, for: .normal) diff --git a/Projects/Features/PlayerFeature/Sources/Views/PlayerView.swift b/Projects/Features/PlayerFeature/Sources/Views/PlayerView.swift index 395047b43..cf2c221cc 100644 --- a/Projects/Features/PlayerFeature/Sources/Views/PlayerView.swift +++ b/Projects/Features/PlayerFeature/Sources/Views/PlayerView.swift @@ -12,7 +12,6 @@ import Utility import DesignSystem import SnapKit import Then -import MarqueeLabel public final class PlayerView: UIView { private lazy var backgroundView = UIView().then { @@ -44,21 +43,9 @@ public final class PlayerView: UIView { $0.distribution = .fill } - internal lazy var titleLabel = WMFlowLabel(text: "제목", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t5(weight: .medium), alignment: .center, lineHeight: UIFont.WMFontSystem.t5().lineHeight, kernValue: -0.5, leadingBuffer: 0, trailingBuffer: 35) + lazy var titleLabel = WMFlowLabel(text: "제목", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t5(weight: .medium), alignment: .center, lineHeight: UIFont.WMFontSystem.t5().lineHeight, kernValue: -0.5, leadingBuffer: 0, trailingBuffer: 35) - internal lazy var artistLabel = MarqueeLabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.medium, size: 14) - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.alpha = 0.6 - $0.text = "아티스트" - $0.setTextWithAttributes(lineHeight: 20, kernValue: -0.5) - $0.textAlignment = .center - $0.leadingBuffer = 0 - $0.trailingBuffer = 20 - $0.fadeLength = 3 - $0.animationDelay = 1 - $0.speed = .rate(30) - } + lazy var artistLabel = WMFlowLabel(text: "아티스트", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t6_1(weight: .medium), alignment: .center, lineHeight: UIFont.WMFontSystem.t6_1().lineHeight, kernValue: -0.5, leadingBuffer: 0, trailingBuffer: 20) internal lazy var thumbnailImageView = UIImageView().then { $0.image = DesignSystemAsset.Player.dummyThumbnailLarge.image @@ -91,19 +78,9 @@ public final class PlayerView: UIView { private lazy var playTimeView: UIView = UIView() - internal lazy var currentPlayTimeLabel = UILabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.medium, size: 12) - $0.textColor = DesignSystemAsset.PrimaryColor.point.color - $0.text = "-:--" - $0.setTextWithAttributes(lineHeight: 18, kernValue: -0.5, lineHeightMultiple: 1.26) - } + lazy var currentPlayTimeLabel = WMLabel(text: "-:--", textColor: DesignSystemAsset.PrimaryColor.point.color, font: .t7(weight: .medium), alignment: .left, lineHeight: UIFont.WMFontSystem.t7().lineHeight, kernValue: -0.5) - internal lazy var totalPlayTimeLabel = UILabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.medium, size: 12) - $0.textColor = DesignSystemAsset.GrayColor.gray400.color - $0.text = "-:--" - $0.setTextWithAttributes(lineHeight: 18, kernValue: -0.5, lineHeightMultiple: 1.26) - } + lazy var totalPlayTimeLabel = WMLabel(text: "-:--", textColor: DesignSystemAsset.GrayColor.gray400.color, font: .t7(weight: .medium), alignment: .left, lineHeight: UIFont.WMFontSystem.t7().lineHeight, kernValue: -0.5) private lazy var buttonBarView: UIView = UIView() diff --git a/Projects/Features/PlayerFeature/Sources/Views/PlaylistTableViewCell.swift b/Projects/Features/PlayerFeature/Sources/Views/PlaylistTableViewCell.swift index bf2ca22f1..756767ec7 100644 --- a/Projects/Features/PlayerFeature/Sources/Views/PlaylistTableViewCell.swift +++ b/Projects/Features/PlayerFeature/Sources/Views/PlaylistTableViewCell.swift @@ -34,22 +34,11 @@ internal class PlaylistTableViewCell: UITableViewCell { $0.distribution = .fill } - internal lazy var titleLabel = UILabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.medium, size: 14) - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.text = "곡 제목" - $0.setTextWithAttributes(lineHeight: 24, kernValue: -0.5) - - $0.textAlignment = .left + lazy var titleLabel = WMLabel(text: "곡 제목", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t6(weight: .medium), alignment: .left, lineHeight: UIFont.WMFontSystem.t6().lineHeight, kernValue: -0.5).then { $0.lineBreakMode = .byTruncatingTail } - internal lazy var artistLabel = UILabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.light, size: 12) - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.text = "아티스트명" - $0.setTextWithAttributes(lineHeight: 18, kernValue: -0.5) - $0.textAlignment = .left + lazy var artistLabel = WMLabel(text: "아티스트명", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t7(weight: .light), alignment: .left, lineHeight: UIFont.WMFontSystem.t7().lineHeight, kernValue: -0.5).then { $0.lineBreakMode = .byTruncatingTail } diff --git a/Projects/Features/PlayerFeature/Sources/Views/PlaylistView.swift b/Projects/Features/PlayerFeature/Sources/Views/PlaylistView.swift index 6290c53c9..372fb6780 100644 --- a/Projects/Features/PlayerFeature/Sources/Views/PlaylistView.swift +++ b/Projects/Features/PlayerFeature/Sources/Views/PlaylistView.swift @@ -33,23 +33,9 @@ public final class PlaylistView: UIView { $0.spacing = 4 } -// internal lazy var titleLabel = UILabel().then { -// $0.font = .init(font: DesignSystemFontFamily.Pretendard.medium, size: 16) -// $0.textColor = DesignSystemAsset.GrayColor.gray900.color -// $0.text = "재생목록" -// $0.setTextWithAttributes(lineHeight: 24, kernValue: -0.5) -// $0.textAlignment = .center -// } + lazy var titleLabel = WMLabel(text: "재생목록", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t5(weight: .medium), alignment: .center, lineHeight: UIFont.WMFontSystem.t5().lineHeight, kernValue: -0.5) - lazy var titleLabel = WMLabel(text: "재생목록", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t5(weight: .medium), alignment: .center, lineHeight: 24, kernValue: -0.5) - - internal lazy var countLabel = UILabel().then { - $0.font = .init(font: DesignSystemFontFamily.Pretendard.bold, size: 18) - $0.textColor = DesignSystemAsset.PrimaryColor.point.color - $0.text = "0" - $0.setTextWithAttributes(lineHeight: 28, kernValue: -0.5) - $0.textAlignment = .center - } + lazy var countLabel = WMLabel(text: "재생목록", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t4(weight: .bold), alignment: .center, lineHeight: UIFont.WMFontSystem.t4().lineHeight, kernValue: -0.5) internal lazy var editButton = RectangleButton(type: .custom).then { $0.setBackgroundColor(.clear, for: .normal) From faa2cec453ae550f741657bd45b4fa81c46e18a2 Mon Sep 17 00:00:00 2001 From: youn9k Date: Wed, 29 Nov 2023 21:27:59 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20ChartFeature=20WM?= =?UTF-8?q?Label=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/ChartContentTableViewCell.swift | 35 +++++++------------ .../Views/PlayButtonForChartView.swift | 7 ++-- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/Projects/Features/ChartFeature/Sources/Views/ChartContentTableViewCell.swift b/Projects/Features/ChartFeature/Sources/Views/ChartContentTableViewCell.swift index c68f0ce28..26011ee25 100644 --- a/Projects/Features/ChartFeature/Sources/Views/ChartContentTableViewCell.swift +++ b/Projects/Features/ChartFeature/Sources/Views/ChartContentTableViewCell.swift @@ -10,11 +10,9 @@ import CommonFeature public final class ChartContentTableViewCell: UITableViewCell { // MARK: - UI - private let rankingLabel = UILabel().then { - $0.textAlignment = .center - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.font = DesignSystemFontFamily.Pretendard.medium.font(size: 16) - } + + private let rankingLabel = WMLabel(text: "0", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t5(weight: .medium), alignment: .center, lineHeight: UIFont.WMFontSystem.t5().lineHeight, kernValue: -0.5) + private let nonImageView = UIImageView().then { $0.image = DesignSystemAsset.Chart.non.image } @@ -27,28 +25,21 @@ public final class ChartContentTableViewCell: UITableViewCell { private let decreaseRateImageView = UIImageView().then { $0.image = DesignSystemAsset.Chart.down.image } - private let newRateLabel = UILabel().then { - $0.textColor = DesignSystemAsset.PrimaryColor.new.color - $0.text = "NEW" - $0.font = DesignSystemFontFamily.Pretendard.medium.font(size: 11) - } - private let rateLabel = UILabel().then { - $0.textAlignment = .center - $0.font = DesignSystemFontFamily.Pretendard.medium.font(size: 11) - } + + private let newRateLabel = WMLabel(text: "NEW", textColor: DesignSystemAsset.PrimaryColor.new.color, font: .t8(weight: .medium), alignment: .left, lineHeight: UIFont.WMFontSystem.t8().lineHeight, kernValue: -0.5) + + private let rateLabel = WMLabel(text: "0", textColor: DesignSystemAsset.PrimaryColor.new.color, font: .t8(weight: .medium), alignment: .center, lineHeight: UIFont.WMFontSystem.t8().lineHeight, kernValue: -0.5) + private let albumImageView = UIImageView().then { $0.clipsToBounds = true $0.layer.cornerRadius = 4 $0.contentMode = .scaleAspectFill } - private let titleStringLabel = UILabel().then { - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) - } - private let groupStringLabel = UILabel().then { - $0.textColor = DesignSystemAsset.GrayColor.gray900.color - $0.font = DesignSystemFontFamily.Pretendard.light.font(size: 12) - } + + private let titleStringLabel = WMLabel(text: "제목", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t6(weight: .medium), alignment: .left, lineHeight: UIFont.WMFontSystem.t6().lineHeight, kernValue: -0.5) + + private let groupStringLabel = WMLabel(text: "아티스트", textColor: DesignSystemAsset.GrayColor.gray900.color, font: .t7(weight: .light), alignment: .left, lineHeight: UIFont.WMFontSystem.t7().lineHeight, kernValue: -0.5) + private let hitsLabel = UILabel().then { $0.textAlignment = .right $0.textColor = DesignSystemAsset.GrayColor.gray900.color diff --git a/Projects/Features/ChartFeature/Sources/Views/PlayButtonForChartView.swift b/Projects/Features/ChartFeature/Sources/Views/PlayButtonForChartView.swift index 2d1783826..2a9344801 100644 --- a/Projects/Features/ChartFeature/Sources/Views/PlayButtonForChartView.swift +++ b/Projects/Features/ChartFeature/Sources/Views/PlayButtonForChartView.swift @@ -37,10 +37,9 @@ public final class PlayButtonForChartView: UIView { range: NSRange(location: 0, length: attributedString.string.count)) $0.setAttributedTitle(attributedString, for: .normal) } - private let updateTimeLabel = UILabel().then { - $0.font = DesignSystemFontFamily.Pretendard.light.font(size: 12) - $0.textColor = DesignSystemAsset.GrayColor.gray600.color - } + + private let updateTimeLabel = WMLabel(text: "업데이트", textColor: DesignSystemAsset.GrayColor.gray600.color, font: .t7(weight: .light), alignment: .left, lineHeight: UIFont.WMFontSystem.t7().lineHeight, kernValue: -0.5) + private let updateTimeImageView = UIImageView().then { $0.image = DesignSystemAsset.Chart.check.image } From 42cf53e385fa781437a8a9477719109925a8a514 Mon Sep 17 00:00:00 2001 From: youn9k Date: Wed, 29 Nov 2023 21:53:58 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20CommonFeature=20W?= =?UTF-8?q?MLabel=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IBOutlet은 제외ㅎ --- .../Sources/Views/ChartUpdateTimeView.swift | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Projects/Features/CommonFeature/Sources/Views/ChartUpdateTimeView.swift b/Projects/Features/CommonFeature/Sources/Views/ChartUpdateTimeView.swift index 511694c0e..5add43383 100644 --- a/Projects/Features/CommonFeature/Sources/Views/ChartUpdateTimeView.swift +++ b/Projects/Features/CommonFeature/Sources/Views/ChartUpdateTimeView.swift @@ -14,10 +14,8 @@ import SnapKit import Then public final class ChartUpdateTimeView: UIView { - private let updateTimeLabel = UILabel().then { - $0.font = DesignSystemFontFamily.Pretendard.light.font(size: 12) - $0.textColor = DesignSystemAsset.GrayColor.gray600.color - } + private let updateTimeLabel = WMLabel(text: "업데이트", textColor: DesignSystemAsset.GrayColor.gray600.color, font: .t7(weight: .light), alignment: .left, lineHeight: UIFont.WMFontSystem.t7().lineHeight, kernValue: -0.5) + private let updateTimeImageView = UIImageView().then { $0.image = DesignSystemAsset.Chart.check.image } @@ -33,12 +31,7 @@ public final class ChartUpdateTimeView: UIView { } public func setUpdateTime(updateTime: String) { - let attributedString = NSMutableAttributedString(string: updateTime) - attributedString.addAttributes([.font: DesignSystemFontFamily.Pretendard.light.font(size: 12), - .foregroundColor: DesignSystemAsset.GrayColor.gray600.color, - .kern: -0.5], - range: NSRange(location: 0, length: attributedString.string.count)) - updateTimeLabel.attributedText = attributedString + updateTimeLabel.text = updateTime } }