Skip to content

Commit

Permalink
✨ :: [#1259] 김치만두 예외처리
Browse files Browse the repository at this point in the history
  • Loading branch information
KangTaeHoon committed Aug 30, 2024
1 parent 6ccfae9 commit 6735c12
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,32 @@ extension ArtistDetailHeaderViewController {
DEBUG_LOG("availableWidth: \(availableWidth)")
DEBUG_LOG("\(model.krName): \(artistNameWidth)")

artistNameAttributedString.addAttributes(
[
.font: availableWidth >= artistNameWidth ?
UIFont.WMFontSystem.t1(weight: .bold).font : UIFont.WMFontSystem.t3(weight: .bold).font
],
range: artistKrNameRange
)
if availableWidth >= artistNameWidth {
artistNameAttributedString.addAttributes(
[.font: UIFont.WMFontSystem.t1(weight: .bold).font],
range: artistKrNameRange
)
} else {
if model.krName.count >= 10 { // ex: 김치만두
artistNameAttributedString.addAttributes(
[.font: UIFont.WMFontSystem.t4(weight: .bold).font],
range: artistKrNameRange
)
} else {
artistNameAttributedString.addAttributes(
[.font: UIFont.WMFontSystem.t3(weight: .bold).font],
range: artistKrNameRange
)

}
}

artistNameLabelHeight.constant = (availableWidth >= artistNameWidth) ?
36 : ceil(artistNameAttributedString.height(containerWidth: availableWidth))
artistNameLabel.attributedText = artistNameAttributedString

artistGroupLabel.text = (model.id == "woowakgood") ? "" : model.groupName + (model.graduated ? " · 졸업" : "")
artistGroupLabel.text = (model.id == "woowakgood") ?
"" : model.groupName + (model.graduated ? " · 졸업" : "")
artistGroupLabel.setTextWithAttributes(
lineHeight: UIFont.WMFontSystem.t6(weight: .medium).lineHeight,
lineBreakMode: .byCharWrapping
Expand Down

0 comments on commit 6735c12

Please sign in to comment.