import UIKit import Foundation extension UIFont{ public enum SFProDisplayType: String { case regular = "Regular" case semiBold = "Semibold" case medium = "Medium" case bold = "Bold" case heavy = "Heavy" case light = "Light" case black = "Black" } static func SFProDisplay(_ type: SFProDisplayType = .regular, size: CGFloat = UIFont.systemFontSize) -> UIFont { return UIFont(name: "SFProDisplay-\(type.rawValue)", size: size)! } var isBold: Bool { return fontDescriptor.symbolicTraits.contains(.traitBold) } var isItalic: Bool { return fontDescriptor.symbolicTraits.contains(.traitItalic) } } label.font = UIFont.systemFont(ofSize: 14, weight: .light)