updated to fix label issue
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
eacee20fe9
commit
5c8ef10eed
@ -65,10 +65,10 @@ public enum TextStyle: String, CaseIterable {
|
||||
//MARK: FontCategory
|
||||
extension TextStyle {
|
||||
public enum FontCategory: String, CaseIterable {
|
||||
case feature = "Feature"
|
||||
case title = "Title"
|
||||
case body = "Body"
|
||||
case micro = "micro"
|
||||
case feature
|
||||
case title
|
||||
case body
|
||||
case micro
|
||||
|
||||
public var sizes: [FontSize] {
|
||||
switch self {
|
||||
@ -84,7 +84,13 @@ extension TextStyle {
|
||||
}
|
||||
|
||||
public func style(for fontSize: FontSize?, isBold: Bool = false) -> TextStyle? {
|
||||
let styleName = "\(isBold ? "Bold" : "")\(self.rawValue)\(fontSize?.rawValue ?? "")"
|
||||
var styleName = ""
|
||||
if isBold {
|
||||
let newRaw = rawValue.prefix(1).description.uppercased() + rawValue.dropFirst()
|
||||
styleName = "\(isBold ? "bold" : "")\(newRaw)\(fontSize?.rawValue ?? "")"
|
||||
} else {
|
||||
styleName = "\(newRaw)\(fontSize?.rawValue ?? "")"
|
||||
}
|
||||
guard let style = TextStyle(rawValue: styleName) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user