Skip to content

Instantly share code, notes, and snippets.

@zrkb
Last active August 7, 2017 23:36
Show Gist options
  • Select an option

  • Save zrkb/038f017d3c6ec31befb6 to your computer and use it in GitHub Desktop.

Select an option

Save zrkb/038f017d3c6ec31befb6 to your computer and use it in GitHub Desktop.
Print Family Fonts
for (NSString *familyName in [UIFont familyNames]){
NSLog(@"Family Name: %@", familyName);
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
NSLog(@"Font Name: %@", fontName);
}
NSLog(@"\n\n");
}
UIFont.familyNames.forEach { (familyName: String) in
print("Family Name: \(familyName)")
UIFont.fontNames(forFamilyName: familyName).forEach({ (fontName: String) in
print("\tFont: \(fontName)")
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment