Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save popcornomnom/1b756e41f1253df0dd2790e5d4dab5b8 to your computer and use it in GitHub Desktop.
Save popcornomnom/1b756e41f1253df0dd2790e5d4dab5b8 to your computer and use it in GitHub Desktop.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
///Update fonts after dynamic fonts settings was changed
if traitCollection.preferredContentSizeCategory != previousTraitCollection?.preferredContentSizeCategory {
setFonts()
}
}
private func setFonts() {
title.font = UIFont(.h3, .black)
subtitle.font = UIFont(.bodyM, .medium)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment