Skip to content

Instantly share code, notes, and snippets.

@marinofelipe
Last active April 8, 2019 03:24
Show Gist options
  • Save marinofelipe/4d97fcdafc413e77eeb71544068bea9e to your computer and use it in GitHub Desktop.
Save marinofelipe/4d97fcdafc413e77eeb71544068bea9e to your computer and use it in GitHub Desktop.
Blog post / Dynamic Type - Custom font improved to work with unwrapped font
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