From 0f0d815c1ccaac507f11c65fcbc107cfd9aa4493 Mon Sep 17 00:00:00 2001 From: yuhaeun-la Date: Fri, 10 May 2024 15:43:18 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20EmptyFavoriteView=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EB=90=9C=20=EA=B8=80=EA=B7=80=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/View/EmptyFavoritesView.swift | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/Projects/Feature/HomeFeature/Sources/View/EmptyFavoritesView.swift b/Projects/Feature/HomeFeature/Sources/View/EmptyFavoritesView.swift index a09a2ea0..77e6b61b 100644 --- a/Projects/Feature/HomeFeature/Sources/View/EmptyFavoritesView.swift +++ b/Projects/Feature/HomeFeature/Sources/View/EmptyFavoritesView.swift @@ -23,6 +23,60 @@ final class EmptyFavoritesView: UIView { return imgView }() + private let messageLabel: UILabel = { + let label = UILabel() + label.font = DesignSystemFontFamily.NanumSquareNeoOTF.regular.font( + size: 15 + ) + label.textColor = DesignSystemAsset.gray6.color + label.textAlignment = .center + label.numberOfLines = 3 + let message1 = NSAttributedString( + string: "확인하고 싶은 버스 정보는\n", + attributes: [ + .font: DesignSystemFontFamily.NanumSquareNeoOTF.regular.font( + size: 15 + ) + ] + ) + let message2 = NSAttributedString( + string: "즐겨찾기로 등록하세요 ", + attributes: [ + .font: DesignSystemFontFamily.NanumSquareNeoOTF.bold.font( + size: 20 + ), + .foregroundColor: DesignSystemAsset.bottonBtnColor.color + ] + ) + let padding = NSAttributedString( + string: "\n", + attributes: [ + .font: DesignSystemFontFamily.NanumSquareNeoOTF.bold.font( + size: 6 + ), + .foregroundColor: DesignSystemAsset.bottonBtnColor.color + ] + ) + let attributedString = NSMutableAttributedString() + attributedString.append(message1) + attributedString.append(padding) + attributedString.append(message2) + label.attributedText = attributedString + return label + }() + + private let exampleLabel: UILabel = { + let label = UILabel() + label.font = .systemFont( + ofSize: 20, + weight: .light + ) + label.text = "ex" + label.textColor = DesignSystemAsset.blueGray.color + label.transform = CGAffineTransform(rotationAngle: -0.3) + return label + }() + private let starImageView: LottieAnimationView = { let imgView = LottieAnimationView( name: "star", @@ -48,6 +102,7 @@ final class EmptyFavoritesView: UIView { backgroundColor = DesignSystemAsset.cellColor.color [ listLottieView, + messageLabel, starImageView ].forEach { addSubview($0) @@ -76,6 +131,13 @@ final class EmptyFavoritesView: UIView { starImageView.heightAnchor.constraint( equalToConstant: 40 ), + messageLabel.centerXAnchor.constraint( + equalTo: centerXAnchor + ), + messageLabel.bottomAnchor.constraint( + equalTo: listLottieView.bottomAnchor, + constant: 80 + ), ]) } }