Skip to content

Instantly share code, notes, and snippets.

@marinofelipe
Last active March 13, 2019 04:15
Show Gist options
  • Save marinofelipe/8c314569ffc6f1783517da5b24830acf to your computer and use it in GitHub Desktop.
Save marinofelipe/8c314569ffc6f1783517da5b24830acf to your computer and use it in GitHub Desktop.
Blog post / Dynamic Type - Using static factory to generate a specific label that has custom scalable font and adjusts it for content size category
extension UILabel {
static var scaledTitle: UILabel {
let label = UILabel()
label.adjustsFontForContentSizeCategory = true
label.font = UIFont.jurassic.scaled
label.numberOfLines = 0
return label
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment