0

I have a label with the text "Berkeley, CA" and I want its voice over to read "Berkeley, California".

I noticed that when I have labels with zip code as well, such as "San Francisco, CA 94106" the voice over knows to convert CA to California automatically.

I know I can set the accessibilityLabel of the label to some text, but since the state comes as input I wonder if there is some way to tell voice over that this is a state without actually code the conversion from each state or country abbreviation to its full name.

Is there a way to tell voice over that this is an address? or is there a built-in way to convert state/country abbreviation to their full name?

Tal Haham
  • 1,500
  • 12
  • 16

1 Answers1

1

To the best of my knowledge, you cannot control how VoiceOver on iOS pronounces such abbreviations, either through code or user preferences. Given that users have no say in the matter, it's fine to override the accessibilityLabel. You might find the NSLinguisticTagger class useful for recognizing user input requiring expansion. CLGeocoder can code an coordinate or address and provide expanded details, but the full state name is not among them.

Justin
  • 20,509
  • 6
  • 47
  • 58