Author
Travis Kirton


All Family Names

To access all the family names that are available on the current iOS you’re developing for, you can call the following class function:

Font.familyNames()

A family name is essentially the top-level name for a font. That is, not including the sub-type names like bold, italic, etc… Here are some examples:

Avenir Next or, Courier New

And not the specific font names, such as:

AvenirNext-Regular or, CourierNewPSMT

Example

if let familyNames = Font.familyNames() as? [String] {
    for name in familyNames.sort({ $0 < $1 }) {
        print(name)
    }
}