fix for 3.0

This commit is contained in:
Kevin G Christiano 2020-05-22 16:30:14 -04:00
parent 7ce534de10
commit eb195afe1d
2 changed files with 13 additions and 3 deletions

View File

@ -402,11 +402,11 @@ public typealias ActionBlock = () -> ()
attributedString.insert(mutableString, at: imageAtt.location)
case let fontAtt as LabelAttributeFontModel:
if let fontStyle = fontAtt.style?.rawValue {
let styles = MFStyler.styleGetAttributedString("0", withStyle: fontStyle)
if let fontStyle = fontAtt.style {
attributedString.removeAttribute(.font, range: range)
attributedString.removeAttribute(.foregroundColor, range: range)
attributedString.addAttributes(styles.attributes(at: 0, effectiveRange: nil), range: range)
attributedString.addAttribute(.font, value: fontStyle.getFont(), range: range)
attributedString.addAttribute(.foregroundColor, value: fontStyle.color(), range: range)
} else {
let fontSize = fontAtt.size
var font: UIFont?

View File

@ -81,6 +81,16 @@ open class Styler {
}
}
public func color() -> UIColor {
switch self {
case .B3:
return .mvmCoolGray6
default:
return .mvmBlack
}
}
/// Determines if the selected font case is bold or regular.
public func isBold() -> Bool {