Created
September 26, 2019 18:36
-
-
Save samuelbezerrab/010eb64bd0fdc79a2066eb8f3ef4cdde to your computer and use it in GitHub Desktop.
List iOS Fonts
This file contains hidden or 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
| //Objective-C | |
| for (NSString *familyName in [UIFont familyNames]){ | |
| NSLog(@"Family name: %@", familyName); | |
| for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) { | |
| NSLog(@"--Font name: %@", fontName); | |
| } | |
| } | |
| // Swift | |
| for familyName:String in UIFont.familyNames { | |
| print("Family Name: \(familyName)") | |
| for fontName:String in UIFont.fontNames(forFamilyName: familyName) { | |
| print("--Font Name: \(fontName)") | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment