Max
Max

Reputation: 5942

iOS - Voice Over - Accessibility for large amounts

I am not able to make iOS voice over / Accessiblity read large amounts in money format for example £782284.00 , this should read as seven hundered eighty two thousand , two hundered and eight four, but iOS voice over reads this as seven eight two two eight four.

Upvotes: 4

Views: 3297

Answers (3)

XLE_22
XLE_22

Reputation: 5671

The best way to get your purpose is to format perfectly your numbers to be vocalized as desired by VoiceOver.

Use of NumberFormatter and .spellOut style to read out the accessibilityLabel are important tools to adapt the VoiceOver vocalization for large amounts.

I deeply encourage you to try and vocalize numbers as they should : the application content MUST be adapted to the VoiceOver users, not the opposite.

Upvotes: 2

Charlie S
Charlie S

Reputation: 4604

It is really important to make sure you do all you can to make the app easier to use for VoiceOver users. I have been running an app for sighted and visually impaired players, you can see an example of this method running in the inventory section of the app: https://apps.apple.com/us/app/swordy-quest-an-rpg-adventure/id1446641513

The number of requests I got from blind & visually impaired players to read out millions as millions, rather than individual digits, was huge. Please do take the extra effort to make it fully VoiceOver compatible. It makes life so much easier for VoiceOver users. Here is a method I created solely for this purpose, that VoiceOver seems to like. You are basically adding thousand comma separators:

// e.g. 1000 -> "1,000"
public static func addCommaSeperatorsToInt(number: Int) -> String {
    let numberFormatter = NumberFormatter()
    numberFormatter.numberStyle = NumberFormatter.Style.decimal
    return numberFormatter.string(from: NSNumber(value: number))!
}

Upvotes: 1

JSBach
JSBach

Reputation: 446

I agree to @aadrian is suggesting, try not to break convention VoiceOver users are used to. Because some large numbers are read in a long time, then the users have slow navigation across numbers.

However, if that is the case you need it hard, here you can have (I couldnot find sth for swift/objc but you will get the idea) a number to word converter and then you can set that to _.accessbilityLabel of the UIView or whatever. Then it will read as you like.

Also see this

Upvotes: -1

Related Questions