<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIButton/attributedTitle(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIButton(im)attributedTitleForState:"
  },
  "title" : "attributedTitle(for:)"
}
-->

# attributedTitle(for:)

Returns the styled title associated with the specified state.

```
func attributedTitle(for state: UIControl.State) -> NSAttributedString?
```

## Parameters

`state`

The state that uses the styled title. The possible values are described in [`UIControl.State`](/documentation/UIKit/UIControl/State-swift.struct).

## Return Value

The title for the specified state. If no attributed title has been set for the specific state, this method returns the attributed title associated with the [`normal`](/documentation/UIKit/UIControl/State-swift.struct/normal) state. If no attributed title has been set for [`normal`](/documentation/UIKit/UIControl/State-swift.struct/normal), returns `nil`.

---

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)