Skip to content

Instantly share code, notes, and snippets.

@khanlou
Created October 6, 2016 21:10
Show Gist options
  • Star 60 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save khanlou/6c0997ff781d8110703105948161872d to your computer and use it in GitHub Desktop.
Save khanlou/6c0997ff781d8110703105948161872d to your computer and use it in GitHub Desktop.
Print all fonts in Swift 3
UIFont.familyNames.forEach({ familyName in
let fontNames = UIFont.fontNames(forFamilyName: familyName)
print(familyName, fontNames)
})
@szubiszon
Copy link

Still working (swift 5) ! Thanks :)

@yuriisamoienko
Copy link

Still works in Swift 5.4.2. Thx

@fnc12
Copy link

fnc12 commented Sep 11, 2021

Same thing with fixed formatting

UIFont.familyNames.forEach({ familyName in
    let fontNames = UIFont.fontNames(forFamilyName: familyName)
    print(familyName, fontNames)
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment