I\'m going through our iOS app to fix accessibility issues. One of the features of the app is a UITextField in which the user can enter search queries. I\'ve set the trait
Derive a custom class from UITextField as follows (code is in Swift but you can adapt to Objective-C):
class MyTextField: UITextField {
override public var accessibilityValue: String? {
get { return self.text }
set { super.accessibilityValue = newValue }
}
}
Use this class as a custom class instead of UITextField. This will stop VoiceOver from reading the placeholder text when the field is empty.
Then set your accessibility label to e.g. "Search" and accessibility hint to whatever you want to hint (see Apple's Guidelines for Creating Hints). You can assign those values programmatically, though it's probably best to assign them in Interface Builder.