Created
May 21, 2018 13:53
-
-
Save malcommac/e50a424c44df48d4144b53e6f42a98fa to your computer and use it in GitHub Desktop.
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 UIFont { | |
func withTraits(traits:UIFontDescriptorSymbolicTraits...) -> UIFont { | |
let descriptor = self.fontDescriptor() | |
.fontDescriptorWithSymbolicTraits(UIFontDescriptorSymbolicTraits(traits)) | |
return UIFont(descriptor: descriptor, size: 0) | |
} | |
func boldItalic() -> UIFont { | |
return withTraits(.TraitBold, .TraitItalic) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment