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)

6 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Alexander BrechmannAlexander Brechmann shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base