---
title: "titleTextAttributes(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uibaritem/titletextattributes(for:)"
---

# titleTextAttributes(for:)

Returns the title’s text attributes for a given control state.

## Declaration

```swift
func titleTextAttributes(for state: UIControl.State) -> [NSAttributedString.Key : Any]?
```

## Parameters

- `state`: The control state for which you want to know the text attributes for the title.

## Return Value

Return Value The title’s text attributes for state.

## Discussion

Discussion The dictionary may contain key-value pairs for text attributes for the font, text color, text shadow color, and text shadow offset using the keys listed in NSString UIKit Additions Reference.

## See Also

### Customizing appearance

- [setTitleTextAttributes(_:for:)](uikit/uibaritem/settitletextattributes(_:for:).md)
