Last active
February 10, 2019 23:45
-
-
Save yfujiki/51ae3ddf457435fbefdc4d2808c010af to your computer and use it in GitHub Desktop.
Another naiive UILabel extension to change font globally
This file contains hidden or 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 { | |
| @objc var substituteFontName: String { | |
| get { | |
| return font.fontName | |
| } | |
| set { | |
| // Called at every UILabel initialization | |
| font = UIFont(name: newValue, size: font.pointSize) | |
| } | |
| } | |
| @objc var substituteBoldFontName: String { | |
| get { | |
| return font.fontName | |
| } | |
| set { | |
| // Called at every UILabel initialization | |
| font = UIFont(name: newValue, size: font.pointSize) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment