I have a UITextView containing a text that is meant for sighted users. I want to add a different non-sighted user-friendly text that will be read-out when VoiceOver is on. I tried adding it as an accessibilityLabel, but VoiceOver read both text. How can I make it read out just the accessible text when VoiceOver is on?
Asked
Active
Viewed 1,261 times
2
-
1Try setting the accessibility value instead of (or as well as) the accessibility label – Kane Cheshire Dec 03 '18 at 16:07
2 Answers
1
it read out just the accessible text when VoiceOver is on below code useful
UITextView.AccessibilityValue="Your Text";
In that You pass text which

halfelf
- 9,737
- 13
- 54
- 63

kevin patel
- 11
- 4
0
I'm not sure it's possible to vocalize a text that's different from the displayed one using a UITextView with VoiceOver... anyway, I haven't found any solution for that.
VoiceOver is not only used by blind people but also by sight-impaired people which means that it's important to maintain a link between what's displayed and what's vocalized.
Using a UITextView means that its text will be vocalized besides the possible accessibility label you add.
If you want to make it read out just the accessible text when VoiceOver is on :
- Listen to the UIAccessibilityIsVoiceOverRunning event.
- Update the text of your UITextView accordingly :
myTextView.text = "text to be adapted to the context."
Following these steps will allow you to reach your goal.

XLE_22
- 5,124
- 3
- 21
- 72