From 5679d60f775fdb5eaef7dcfa8e4ca7bb2f8d2927 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 28 Sep 2023 01:17:34 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20::=20DesignSysstem=20/=20MajorsLab?= =?UTF-8?q?el=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Label/MajorsLabel.swift | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Idea-Archive/Sources/DesignSystem/Sources/Label/MajorsLabel.swift b/Idea-Archive/Sources/DesignSystem/Sources/Label/MajorsLabel.swift index e69de29..7bff5e8 100644 --- a/Idea-Archive/Sources/DesignSystem/Sources/Label/MajorsLabel.swift +++ b/Idea-Archive/Sources/DesignSystem/Sources/Label/MajorsLabel.swift @@ -0,0 +1,22 @@ +import UIKit + +class MajorsLabel: UILabel { + private var padding = UIEdgeInsets(top: 6.0, left: 12.0, bottom: 6.0, right: 12.0) + + convenience init(padding: UIEdgeInsets) { + self.init() + self.padding = padding + } + + override func drawText(in rect: CGRect) { + super.drawText(in: rect.inset(by: padding)) + } + + override var intrinsicContentSize: CGSize { + var contentSize = super.intrinsicContentSize + contentSize.height += padding.top + padding.bottom + contentSize.width += padding.left + padding.right + + return contentSize + } +}