Skip to content

Instantly share code, notes, and snippets.

@ZevEisenberg
Created December 14, 2015 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZevEisenberg/192cbc24d644dbaa9021 to your computer and use it in GitHub Desktop.
Save ZevEisenberg/192cbc24d644dbaa9021 to your computer and use it in GitHub Desktop.
Version of a UIFont with different symbolic traits
static UIFont *versionOfFontWithSymbolicTraits(UIFont *font, UIFontDescriptorSymbolicTraits symbolicTraits)
{
UIFontDescriptor *descriptor = font.fontDescriptor;
UIFontDescriptor *descriptorToUse = [descriptor fontDescriptorWithSymbolicTraits:symbolicTraits];
UIFont *newFont = [UIFont fontWithDescriptor:descriptorToUse size:font.pointSize];
return newFont;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment