Skip to content

Instantly share code, notes, and snippets.

@yfujiki
Last active February 10, 2019 23:45
Show Gist options
  • Save yfujiki/51ae3ddf457435fbefdc4d2808c010af to your computer and use it in GitHub Desktop.
Save yfujiki/51ae3ddf457435fbefdc4d2808c010af to your computer and use it in GitHub Desktop.
Another naiive UILabel extension to change font globally
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