Skip to content

Instantly share code, notes, and snippets.

@marinofelipe
Last active April 8, 2019 03:23
Show Gist options
  • Select an option

  • Save marinofelipe/824d12a71f6f573e87197659ef616097 to your computer and use it in GitHub Desktop.

Select an option

Save marinofelipe/824d12a71f6f573e87197659ef616097 to your computer and use it in GitHub Desktop.
Blog post / Dynamic Type - Setting a scaled custom font using UIFontMetrics with title1 text style
if #available(iOS 11.0, *) {
if let font = UIFont(name: "custom", size: 20.0) {
label.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: font)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment