Last active
March 13, 2019 04:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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