Contents

pickerView(_:accessibilityAttributedLabelForComponent:)

Returns an attributed string that identifies the picker view component.

Declaration

optional func pickerView(_ pickerView: UIPickerView, accessibilityAttributedLabelForComponent component: Int) -> NSAttributedString?

Parameters

  • pickerView:

    The picker view object.

  • component:

    The component in the picker view that requires a label.

Return Value

The attributed string that identifies the picker view component

Discussion

Use this method to provide descriptive information for the components of a picker view. Your attributed string may include the UIAccessibilitySpeechAttributeLanguage attribute, which lets you use different language synthesizers for different parts of the string. The system prefers this method over the pickerView(_:accessibilityLabelForComponent:) method. For in-depth information on how to create an appropriate descriptive string, see Crafting Useful Labels and Hints.

See Also

Providing descriptive information