---
title: "object(forKey:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uifontdescriptor/object(forkey:)"
---

# object(forKey:)

Returns the font attribute that the corresponding key specifies.

## Declaration

```swift
func object(forKey anAttribute: UIFontDescriptor.AttributeName) -> Any?
```

## Parameters

- `anAttribute`: The font attribute key.

## Return Value

Return Value The font attribute corresponding to anAttribute. For valid values of anAttribute, see UIFontDescriptor.AttributeName.

## See Also

### Querying a font descriptor

- [fontAttributes](uikit/uifontdescriptor/fontattributes.md)
- [matrix](uikit/uifontdescriptor/matrix.md)
- [pointSize](uikit/uifontdescriptor/pointsize.md)
- [postscriptName](uikit/uifontdescriptor/postscriptname.md)
- [symbolicTraits](uikit/uifontdescriptor/symbolictraits-swift.property.md)
- [UIFontDescriptor.SymbolicTraits](uikit/uifontdescriptor/symbolictraits-swift.struct.md)
