title: Set Specific Font Weight for UILabel in Swift
body: <p>When people have asked how to set a bold font, most people suggest: </p>
  
  <pre><code>let boldFont = UIFont.boldSystemFont(ofSize: ___)
  </code></pre>
  
  <p>But take a look at all the font weights that the standard system font offers:</p>
  
  <p><a href="https://i.stack.imgur.com/2QyEe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2QyEe.png" alt="Xcode system font weights"></a></p>
  
  <p>So my question is how do you set a light, semibold, or heavy font weight? The only way that I know how is:</p>
  
  <pre><code>sectionLabel.font = [UIFont fontWithName:@"TrebuchetMS-Bold" size:18];
  </code></pre>
  
  <p>However, I'm still asking because this isn't strongly typed. Most other class attributes are set by selecting from a fixed set of options and don't require passing a string that I could mistype. I guess I could set my own global enum... But any better ideas?</p>