Carefully name your image resource files, it will help blind people!

Aug 24, 2010   //   by Romain Vincens   //   Blog  //  7 Comments

A few days ago, while working on a project for partially sighted people, I tried to run on my iPhone the apps I’ve been working on in the past with Voice Over turned on (Settings / General / Accessibility / Voice Over). While I was testing the apps, something came to me as a surprise. Voice Over was able to speach something on a button with no text, only an icon on it. While I would have understood it if there was a title or an ‘alt’ text attached to the button (like those on img tags in HTML), actually it had not.

So I decided to create a project from scratch, drop a few buttons on a view, all with different configurations applied to them and see how VoiceOver behaves with them on the iPhone. And then I realised that VoiceOver was saying the name of the picture file that was used in the button. Pretty, elegant solution by Apple for untitled buttons. And then I felt happy because in my work I’ve always been meticulous at naming the images I use in my project. Just so that it’s easy to understand their purpose. But now it has a functional purpose too :)

Apple has always taken care of disabled people within their operating systems and apps. Of course it doesn’t do miracles in iPhoto for blind people but it helps in many situations, like writing a mail or browsing the web, even on an iPhone.
Their implementation of the VoiceOver technology is great. It’s build right in the system and as long as you use Apple’s standard APIs, your application will be VoiceOver compatible (that means do not put text inside images!). Their technology is much more efficient than other third-party technologies you can find on Windows for instance (thinking of jaws).

VoiceOver in action

The bottom-left 'position' button selected by VoiceOver. It synthesizes "Start tracking, button", probably because the image file is named startTracking.png

To sum up, when the VoiceOver UI selects a button, it will try to synthethize, in this order:

  • the text set in the button title, if any
  • the name of the image used in the button (setImage:forState:)
  • the name of the background image used in the button (setBackgroundImage:forState:)
  • otherwise a default ‘Button’ will be spoken

So next time you code an application, just think that targetting disabled people may be as easy as finding an appropriate name to your image files!

7 Comments

Leave a comment