This file contains hidden or 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 { | |
class func italicSystemFont(ofSize size: CGFloat, weight: UIFont.Weight = .regular)-> UIFont { | |
let font = UIFont.systemFont(ofSize: size, weight: weight) | |
switch weight { | |
case .ultraLight, .light, .thin, .regular: | |
return font.withTraits(.traitItalic, ofSize: size) | |
case .medium, .semibold, .bold, .heavy, .black: | |
return font.withTraits(.traitBold, .traitItalic, ofSize: size) | |
default: |