Skip to content

Commit

Permalink
#171: Tag 상속 클래스 UILabel > TagLabel 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-muuu committed Feb 11, 2023
1 parent 1502283 commit ed41611
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions Zatch/Global/Source/Component/Tag/Tag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension ZatchComponent{
}
}

class Tag: UILabel{
class Tag: TagLabel{

var isDisabled = false{
didSet{
Expand All @@ -50,27 +50,14 @@ extension ZatchComponent{
init(color: TagColor, configuration: TagType){
self.colorType = color
self.configuration = configuration
super.init(frame: .zero)
super.init(padding: configuration.padding)
initialize()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func drawText(in rect: CGRect) {
let inset = configuration.padding.inset
super.drawText(in: rect.inset(by: inset))
}

override var intrinsicContentSize: CGSize{
let padding = configuration.padding
var contentSize = super.intrinsicContentSize
contentSize.height += padding.top + padding.bottom
contentSize.width += padding.left + padding.right
return contentSize
}

private func initialize(){
style()
layout()
Expand Down

0 comments on commit ed41611

Please sign in to comment.