diff --git a/VDS/Components/Label/Attributes/LabelAttributeModel.swift b/VDS/Components/Label/Attributes/LabelAttributeModel.swift index 8d5c02e1..321e2074 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeModel.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeModel.swift @@ -38,16 +38,7 @@ public extension NSAttributedString { } static func createAttributeModelFor(key: NSAttributedString.Key, range: NSRange, value: Any) -> (any LabelAttributeModel)? { - switch key { - case NSAttributedString.Key.font: - let value = value as! UIFont - let style = TypographicalStyle.style(for: value.fontName, size: value.pointSize) - return FontLabelAttribute(location: range.location, length: range.length, style: style) - case NSAttributedString.Key.foregroundColor: - return ColorLabelAttribute(location: range.location, length: range.length, color: value as! UIColor) - default: - return nil - } + guard let value = value as? AnyHashable else { return nil } + return AnyAttribute(location: range.location, length: range.length, key: key, value: value) } - }