Skip to content

Commit

Permalink
Merge pull request #56 from Idea-Archive/add-MajorsLabel
Browse files Browse the repository at this point in the history
๐Ÿ”€ :: DesignSysstem / MajorsLabel ์ถ”๊ฐ€
  • Loading branch information
uuuunseo authored Sep 28, 2023
2 parents e0ca8c2 + 5679d60 commit 3de5c13
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Idea-Archive/Sources/DesignSystem/Sources/Label/MajorsLabel.swift
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 3de5c13

Please sign in to comment.