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

# setTitleColor(_:for:)

Sets the color of the title to use for the specified state.

```
func setTitleColor(_ color: UIColor?, for state: UIControl.State)
```

## Parameters

`color`

The color of the title to use for the specified state.

`state`

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

## Discussion

In general, if a property is not specified for a state, the default is to use the [`normal`](/documentation/UIKit/UIControl/State-swift.struct/normal) value. If the [`normal`](/documentation/UIKit/UIControl/State-swift.struct/normal) value is not set, then the property defaults to a system value. Therefore, at a minimum, you should set the value for the normal state.

---

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)