I suggest you ...

Export whole typeface for iOS as extension for UILabel

For our iOS developers it would be nice to get an "better" extension for the font book like the Android way.

It would be nice for them to just call it like this:

> myLabel.set(style: .bodyLightInverseSmallest)

Here is an example for an implementation how we use it currently:

struct Typeface {

let textColor: UIColor
let font: UIFont
let alginment: NSTextAlignment = .left

}

extension Typeface {

static let bodyMediumInverse: Typeface = Typeface(textColor: .white, font: .bodyMediumInverseFont())
static let bodyLightInverse: Typeface = Typeface(textColor: .white, font: .bodyLightInverseFont())
static let bodyLightInverseSmallest: Typeface = Typeface(textColor: .white, font: .bodyLightInverseSmallestFont())
static let bodyRegularInverseSmaller: Typeface = Typeface(textColor: .white, font: .bodyRegularSmallerFont())

}

extension UILabel {

func set(style: Typeface) {
textColor = style.textColor
font = style.font
textAlignment = style.alginment
}

}

myLabel.set(style: .bodyLightInverseSmallest)

7 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Alexander Brechmann shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Anonymous commented  ·   ·  Flag as inappropriate

    indeed, i agree with alexander. We can't use the actual configuration, everyone in iOS use UILabel!

Feedback and Knowledge Base