Created
September 12, 2014 16:13
-
-
Save iamjason/ccb746658f626d225740 to your computer and use it in GitHub Desktop.
Prints out all of the Fonts available. (Helpful for using custom fonts)
This file contains 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
for familyName in UIFont.familyNames() as [String] { | |
println("\(familyName)") | |
for fontName in UIFont.fontNamesForFamilyName(familyName) as [String] { | |
println("\tFont: \(fontName)") | |
} | |
} |
for familyName in UIFont.familyNames as [String] {
print("\(familyName)")
for fontName in UIFont.fontNames(forFamilyName: familyName) as [String] {
print("\tFont: \(fontName)")
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A convenient Swift 3 oneliner to get the installed font family names:
UIFont.familyNames.sorted().forEach({print($0)})