Skip to content

Instantly share code, notes, and snippets.

@IvanovDeveloper
Last active January 31, 2021 17:32
Show Gist options
  • Save IvanovDeveloper/ddaf99ae28c481e3a211227a26b0d55a to your computer and use it in GitHub Desktop.
Save IvanovDeveloper/ddaf99ae28c481e3a211227a26b0d55a to your computer and use it in GitHub Desktop.
log all the fonts available to your app in the console
//Obhective-C
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
}
}
//Swift
for family: String in UIFont.familyNames()
{
print("\(family)")
for names: String in UIFont.fontNamesForFamilyName(family)
{
print("== \(names)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment