<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFontDescriptor/TraitKey/weight",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@UIFontWeightTrait"
  },
  "title" : "weight"
}
-->

# weight

The numerical value that corresponds to a font face.

```
static let weight: UIFontDescriptor.TraitKey
```

## Discussion

The value of this key is an <doc://com.apple.documentation/documentation/Foundation/NSNumber> object. The valid value range is from `-1.0` to `1.0`, where `0.0` corresponds to the [`regular`](/documentation/UIKit/UIFont/Weight/regular) weight constant. The negative side of the value range indicates that the font is light or thin; the positive side means the font is heavier or bolder. For example, the font face [`ultraLight`](/documentation/UIKit/UIFont/Weight/ultraLight) has the approximate value of `-0.8`, and [`black`](/documentation/UIKit/UIFont/Weight/black) has the approximate value of `0.62`. When providing a weight that doesn’t precisely match a font face in the family, the system locates an available face that represents the closest match.

You can use a font face constant to specify a weight; for a list of constants, see [`UIFont.Weight`](/documentation/UIKit/UIFont/Weight).

To access the weight of a font, first retrieve the font’s [`traits`](/documentation/UIKit/UIFontDescriptor/AttributeName/traits) dictionary information:

```swift
let font = UIFont.systemFont(ofSize: 21, weight: .bold)
if let traits = font.fontDescriptor.object(forKey: .traits) as? [UIFontDescriptor.TraitKey: Any]{
    let weightValue = traits[.weight]
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)