Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
extension UIFont.Size {
var debugDescription: String { "\(self)" }
extension UIFont {
class func printAllFonts() {
let families = UIFont.Family.allCases
let sizes = UIFont.Size.allCases
let weights = UIFont.CustomWeight.allCases
let string = { family in
"\(family.rawValue):" + { size in
"\n\t\(size.debugDescription):\n\t\t" + { weight in
"\(UIFont(family, size, weight))"
}.joined(separator: "\n\t\t")
}.joined(separator: "\n")
}.joined(separator: "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment