Created
April 22, 2020 09:59
-
-
Save bennokress/199fd13e1bfa4cf6b0364ae1fd1f0ec8 to your computer and use it in GitHub Desktop.
Extensions for Swift's UIFont Type.
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
import UIKit | |
extension UIFont { | |
/// Prints all fonts that can be used with `UIFont(name:, size:)` to the console. | |
static func printAllAvailableFontNames() { | |
for familyName in UIFont.familyNames { | |
print("\n\(familyName)") | |
for fontName in UIFont.fontNames(forFamilyName: familyName) { | |
print("\t- \(fontName)") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment