Last active
April 8, 2019 03:24
-
-
Save marinofelipe/4d97fcdafc413e77eeb71544068bea9e to your computer and use it in GitHub Desktop.
Blog post / Dynamic Type - Custom font improved to work with unwrapped font
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
extension CustomFont where Self: RawRepresentable, Self.RawValue == String { | |
func sized(_ size: CGFloat) -> UIFont { | |
return UIFont(name: self.rawValue, size: size).unwrapped | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment