Skip to content

Commit

Permalink
Merge pull request #1226 from wakmusic/1225-bug-fix-name-in-artist
Browse files Browse the repository at this point in the history
  • Loading branch information
KangTaeHoon authored Aug 25, 2024
2 parents c079672 + 23f22e6 commit 537a9c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public extension ArtistDetailResponseDTO {
let enName: String

private enum CodingKeys: String, CodingKey {
case krName = "krShort"
case krName = "kr"
case enName = "en"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public extension ArtistListResponseDTO {
let enName: String

private enum CodingKeys: String, CodingKey {
case krName = "krShort"
case krName = "kr"
case enName = "en"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ class ArtistDetailHeaderViewController: UIViewController, ViewControllerFromStor
extension ArtistDetailHeaderViewController {
func update(model: ArtistEntity) {
self.model = model
let artistName: String = model.krName
let artistEngName: String = model.enName.capitalizingFirstLetter
let artistKrName: String = model.krName
let artistEnName: String = model.enName
let artistNameAttributedString = NSMutableAttributedString(
string: artistName + " " + artistEngName,
string: artistKrName + " " + artistEnName,
attributes: [
.font: DesignSystemFontFamily.Pretendard.bold.font(size: 24),
.foregroundColor: DesignSystemAsset.BlueGrayColor.gray900.color,
.kern: -0.5
]
)

let artistNameRange = (artistNameAttributedString.string as NSString).range(of: artistName)
let artistEngNameRange = (artistNameAttributedString.string as NSString).range(of: artistEngName)
let artistKrNameRange = (artistNameAttributedString.string as NSString).range(of: artistKrName)
let artistEnNameRange = (artistNameAttributedString.string as NSString).range(of: artistEnName)

artistNameAttributedString.addAttributes(
[
.font: DesignSystemFontFamily.Pretendard.light.font(size: 14),
.foregroundColor: DesignSystemAsset.BlueGrayColor.gray900.color.withAlphaComponent(0.6),
.kern: -0.5
],
range: artistEngNameRange
range: artistEnNameRange
)

let margin: CGFloat = 104.0
Expand All @@ -83,7 +83,7 @@ extension ArtistDetailHeaderViewController {

artistNameAttributedString.addAttributes(
[.font: DesignSystemFontFamily.Pretendard.bold.font(size: availableWidth >= artistNameWidth ? 24 : 20)],
range: artistNameRange
range: artistKrNameRange
)

self.artistNameLabelHeight.constant =
Expand Down

0 comments on commit 537a9c0

Please sign in to comment.