Day 52

UIColor accessibilityName for color labels

9 Jul 2022

Since iOS 14, you can get a human readable localised name for a UIColor, with a very useful property called accessibilityName, that you can use in accessibility attributes like labels or values. How cool is that?

https://developer.apple.com/documentation/uikit/uicolor/accessibilityname

iPad app for drawing sketches. It has a tool panel. The selected tool is a pen with the yellow color. There are some predefined colors to choose from. The fifth one is red. Using the accessibilityName from UIColor, we could configure an accessibility value for the pen, so VoiceOver would announce something like:

Some of you have asked me how you can support what I do. This would really help, and would be hugely appreciated:

  • Find these posts useful? Share them at work, on social media, or with anyone that might find them interesting. Let's spread the word!

  • Check out any of my apps or games: Xarra!, RetroRapid!, or Mestre!.

    • A download and a review go a long way. They're free by default. On the App Store, ratings and reviews really help more people discover them.

    • Finding any of them useful? If so, and if you can afford it, purchasing lifetime access to all features or subscribing lets me buy the coffee that keeps me caffeinated. Caffeine keeps me going to maintain the apps, bring in new features that I hope you'll love, and keep writing.

You may also find interesting...

@BeMyEyes, founded by @hjwiberg, enables people who are blind and low vision to identify objects by pairing them with volunteers from around the world using their camera. Winner of an Apple Design Award 2021 for Social Impact.

Support both orientations, if possible. I know not even iOS itself does it, but it hasn't always been like that. You'll create a more robust UI that will be easier to port to iPadOS. And especially, don't force your users to rotate their devices.

Today I want to share something I use a lot. You can convert any article into a “podcast” by enabling Speak Screen in Accessibility Settings, switching to Safari’s Reader Mode and swiping down with two fingers from the top of the screen. I think it is a good example of how if we all knew more about how to use the assistive tech available in iOS, we would find ourselves using more of them, more often, exemplifying quite well that accessibility benefits everyone.


Content © Daniel Devesa Derksen-Staats on Accessibility up to 11! is licensed under CC BY 4.0. License details