views:

97

answers:

1

I've been doing reading about VoiceOver on iPhone, but I can't find anyone talking about how to mark content as a certain language and use more than one language in an app. I want to make my dictionary VoiceOver compatible.

For example this can be written in a UITableViewCell (English then German) and VoiceOver will read this line with two different voices:

to drink - trinken

If this is not possible, then VoiceOver users cannot use any content that has more than one language at a time.

+2  A: 

Apple has defined a protocol, see the documentation here, named UIAccessibility which is implemented by all views in UIKit. The protocol defines the property accessibilityLanguage which sets the language of an element. The default is to return nil which is interpreted as the user's default language.

As far as single views are concerned it seems impossible to choose two different languages at the same time. However, it seems to be possible to declare two separate views (one with an English, the other one with, let's say, a German label) and override the above method for both views, returning different languages for both. This way you can effectively use two different languages with VoiceOver in your application.

user8472