Created
March 10, 2015 10:30
-
-
Save frederik-jacques/b060557e2392f78ebab7 to your computer and use it in GitHub Desktop.
A Swift function to loop over all available font families and print out the different font names. You need this if you want to use custom fonts in your app and pass in the name for the UIFont class.
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
func enumerateFonts(){ | |
for fontFamily in UIFont.familyNames() { | |
println("Font family name = \(fontFamily as String)"); | |
for fontName in UIFont.fontNamesForFamilyName(fontFamily as String) { | |
println("- Font name = \(fontName)"); | |
} | |
println("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Swift 3