I am trying to set accessibility label for UIPickerView component, but the delegate method is never called. What's more, UIInspector shows the pickerView is not accessible, but it has the label actually set.
The dataSource/delegate methods are fired. Only the UIAccessibilityDelegate is not.
Tested on xcode 10.1 iOS 12.1 simulator
class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate, UIPickerViewAccessibilityDelegate {
@IBOutlet weak var pickerView: UIPickerView!
override func viewDidLoad() {
super.viewDidLoad()
pickerView.isAccessibilityElement = true
pickerView.accessibilityLabel = "TESTAccLabel"
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return 5
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 2
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return "\(component) - \(row)"
}
func pickerView(_ pickerView: UIPickerView, accessibilityLabelForComponent component: Int) -> String? {
return "TODO:JS"
}
}