How to find the list of fonts with swift/objective-c ?

How to find the list of fonts with swift/objective-c ?

Published on 2019-05-26 in Development

The source code to retrieve the list of fonts written in objective-c, and in swift

Swift

 for famille:String in UIFont.familyNames {
     print("Familly : \(famille)")
     for police:String in UIFont.fontNames(forFamilyName: famille) {
         print("- Name : \(police)")
     }
 }

Objective-C

for (NSString *famille in [UIFont familyNames]){
    NSLog(@"Familly : %@", famille);
    for (NSString *police in [UIFont fontNamesForFamilyName:famille]) {
        NSLog(@"- Name : %@", police);
    }
}

swift   objective-c   fonts  

Comment récupérer la liste des polices d'écritures en objective-c/swift ?