title: How to make system font "Black Italic" in swift?
body: <p>I am trying to add a system font of weight "Heavy" (not bold) and also try to make it italic. I saw other stackoverflow solutions but it does not seem to work. Here is what I have done:</p>
  
  <pre><code>let percentageLabel: UILabel = {
         let label = UILabel()
          label.text = "0"
          label.textAlignment = .center
          label.textColor = .white
          label.font = UIFont.systemFont(ofSize: 32, weight: .heavy, traits: .traitItalic)
         return label
      }()
  </code></pre>
  
  <p>Extension as suggested in a stack overflow post</p>
  
  <pre><code>extension UIFont {
  
      static func systemFont(ofSize: CGFloat, weight: UIFont.Weight, traits: UIFontDescriptor.SymbolicTraits) -&gt; UIFont? {
           let font = UIFont.systemFont(ofSize: ofSize, weight: weight)
  
           if let descriptor = font.fontDescriptor.withSymbolicTraits(traits) {
               return UIFont(descriptor: descriptor, size: ofSize)
           }
  
           return nil
       }
  }
  </code></pre>
  
  <p>Thing is when I tried all suggested solutions, bold and italic seems to work BUT black and italic doesn't work. It is still rendered as regular italic.</p>