iOS Developer Library

Developer

UIKit Framework Reference UIPickerViewAccessibilityDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIPickerViewAccessibilityDelegate

Inheritance


Not Applicable

Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 4.0 and later.

The UIPickerViewAccessibilityDelegate protocol defines methods you can implement to provide accessibility information for individual components of a picker view.

  • Returns a label that identifies the picker view component.

    Declaration

    Swift

    optional func pickerView(_ pickerView: UIPickerView, accessibilityLabelForComponent component: Int) -> String

    Objective-C

    - (NSString *)pickerView:(UIPickerView *)pickerView accessibilityLabelForComponent:(NSInteger)component

    Return Value

    A succinct label, in a localized string, that identifies the picker view component.

    Discussion

    Implement this optional method to ensure that the accessibility element representing the picker view provides an appropriate label for each component. For in-depth information on how to create an appropriate label, see Crafting Useful Labels and Hints.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.0 and later.

  • Returns a hint that describes the result of performing an action on the picker view component.

    Declaration

    Swift

    optional func pickerView(_ pickerView: UIPickerView, accessibilityHintForComponent component: Int) -> String

    Objective-C

    - (NSString *)pickerView:(UIPickerView *)pickerView accessibilityHintForComponent:(NSInteger)component

    Return Value

    A brief description, in a localized string, of the result of performing an action on the picker view component.

    Discussion

    Implement this optional method to ensure that the accessibility element representing the picker view provides an appropriate hint for each component. For in-depth information on how to create an appropriate hint, see Guidelines for Creating Hints.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.0 and later.