title: Add custom weight to iOS Font descriptor in Swift
body: <p>This seems like it should be rudimentarily easy, but for whatever reason it's not working. I've read similar posts on SO and it seems like there might be an issue with the Font Traits dictionary? Is this an issue or am I just completely missing something? This is my first time messing around with fonts like this so I think it might be the latter.</p>
  <p>I don't want to use the constants or supply a font with it's &quot;-bold&quot; variant. I would like to have fine grain control over the font weight.</p>
  <pre><code>let traits = [UIFontWeightTrait : 1.0]
  imgFontDescriptor = UIFontDescriptor(fontAttributes: [UIFontDescriptorNameAttribute: &quot;Helvetica&quot;])
  imgFontDescriptor = imgFontDescriptor.fontDescriptorByAddingAttributes([UIFontDescriptorTraitsAttribute:traits])
  imgTextFont = UIFont(descriptor: imgFontDescriptor!, size: 24.0)
  </code></pre>
  <p><strong>Research:</strong></p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/25977207/font-descriptor-returns-nil-in-ios-8">Font Descriptor returns nil in iOS 8</a></li>
  <li><a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIFontDescriptor_Class/#//apple_ref/doc/constant_group/Font_Traits_Dictionary_Keys" rel="nofollow noreferrer">https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIFontDescriptor_Class/#//apple_ref/doc/constant_group/Font_Traits_Dictionary_Keys</a></li>
  </ul>
  <p>According to the iOS docs using a number value should work (I'm running iOS 9.2):</p>
  <blockquote>
  <p>UIFontWeightTrait</p>
  <p>The normalized weight value as an NSNumber object. The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular or medium font weight. You can also use a font weight constant to specify a particular weight; for a list of constants you can use, see Font Weights. Available in iOS 7.0 and later.</p>
  </blockquote>