Skip to content

Instantly share code, notes, and snippets.

@unledrob
Created July 15, 2017 14:16
Show Gist options
  • Select an option

  • Save unledrob/fb11cf7a155fcb578e3e7a1da621b607 to your computer and use it in GitHub Desktop.

Select an option

Save unledrob/fb11cf7a155fcb578e3e7a1da621b607 to your computer and use it in GitHub Desktop.
Get the installed font for an iOS application. This helps instantiating a new UIFont by name since the name is sometimes not apparent. Note: be sure to add the font to Info.plist first.
// THANKS: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
for family: String in UIFont.familyNames {
print("\(family)")
for names: String in UIFont.fontNames(forFamilyName: family) {
print("== \(names)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment