<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPickerViewDelegate/pickerView(_:attributedTitleForRow:forComponent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIPickerViewDelegate(im)pickerView:attributedTitleForRow:forComponent:"
  },
  "title" : "pickerView(_:attributedTitleForRow:forComponent:)"
}
-->

# pickerView(_:attributedTitleForRow:forComponent:)

Called by the picker view when it needs the styled title to use for a given row in a given component.

```
optional func pickerView(_ pickerView: UIPickerView, attributedTitleForRow row: Int, forComponent component: Int) -> NSAttributedString?
```

## Parameters

`pickerView`

An object representing the picker view requesting the data.

`row`

A zero-indexed number identifying a row of `component`. Rows are numbered top-to-bottom.

`component`

A zero-indexed number identifying a component of `pickerView`. Components are numbered left-to-right.

## Return Value

The attributed string to use as the title of the indicated component row.

## Discussion

If you implement both this method and the [`pickerView(_:titleForRow:forComponent:)`](/documentation/UIKit/UIPickerViewDelegate/pickerView(_:titleForRow:forComponent:)) method, the picker view prefers the use of this method. However, if your implementation of this method returns `nil`, the picker view falls back to using the string returned by the [`pickerView(_:titleForRow:forComponent:)`](/documentation/UIKit/UIPickerViewDelegate/pickerView(_:titleForRow:forComponent:)) method.

---

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)