Created
March 21, 2020 17:46
-
-
Save popcornomnom/a677d549aa216b071ac92d336557c63b to your computer and use it in GitHub Desktop.
This file contains 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
#if DEBUG | |
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 = families.map { family in | |
"\(family.rawValue):" + sizes.map { size in | |
"\n\t\(size.debugDescription):\n\t\t" + weights.map { weight in | |
"\(UIFont(family, size, weight))" | |
}.joined(separator: "\n\t\t") | |
}.joined(separator: "\n") | |
}.joined(separator: "\n") | |
print(string) | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment