more label fix

This commit is contained in:
Pfeil, Scott Robert 2020-01-17 14:07:31 -05:00
parent 6aba575703
commit d80ae0bd04

View File

@ -263,13 +263,13 @@ public typealias ActionBlock = () -> ()
}
if let attributes = labelModel.attributes, let labelText = text {
let attributedString = NSMutableAttributedString(string: labelText, attributes: [NSAttributedString.Key.font: font as UIFont, NSAttributedString.Key.foregroundColor: textColor as UIColor])
let attributedString = NSMutableAttributedString(string: labelText, attributes: [NSAttributedString.Key.font: font.withSize(standardFontSize), NSAttributedString.Key.foregroundColor: textColor as UIColor])
for attribute in attributes {
let range = NSRange(location: attribute.location, length: attribute.length)
switch attribute {
case let _ as LabelAttributeUnderlineModel:
case _ as LabelAttributeUnderlineModel:
attributedString.addAttribute(.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: range)
case let _ as LabelAttributeStrikeThroughModel:
case _ as LabelAttributeStrikeThroughModel:
attributedString.addAttribute(.strikethroughStyle, value: NSUnderlineStyle.thick.rawValue, range: range)
attributedString.addAttribute(.baselineOffset, value: 0, range: range)
case let colorAtt as LabelAttributeColorModel: