Adopting Voice Control

My team has been hard at work gearing up for the iOS 13 release. As a part of that, and one of the things I’m very passionate about, is making sure that any app that I work on is up to speed with the latest advances in accessibility. A huge part of this year’s WWDC was the introduction of voice control which allows users to navigate their phone interfaces using just their voice. Here’s a look at some of the things we are doing to adopt this amazing technology.

Before we begin

Here are a couple of setup tips to make testing voice control easier:

Turn on Voice Control in your Accessibility Shortcut

Settings -> Accessibility -> Accessibility Shortcut

This allows you to triple-click your home button to turn on and off voice control quickly.

Turn on Continuous Overlay

Settings -> Accessibility -> Voice Control -> Overlay -> Item Names

You’ll be able to use this to tell at-a-glance how your voice control labels will behave.

Accessibility labels

95% or more of your work will be done if you make sure you support accessibility labels throughout your app. If you’re not familiar with how to do this, I highly recommend this tutorial from Ray Wenderlich.

Shorten your names

In the Self-Employed app, we had implemented accessibility labels quite a while ago to support voiceover for our visually impaired users. We even added custom accessibility labels for our table view cells to give a summary of the details in that cell rather than just listing out a bunch of jumbled strings.

Long transaction labels in voice control

Unfortunately, those custom accessibility labels did not translate well for voice control users 😟. From my experiments, you cannot get voice control to tap on a named item unless you say the entire phrase. As you can see, the transaction cell labels, in particular, are very verbose and almost impossible for the user to say correctly.

Luckily, there’s a solution for this. As a part of the iOS 13 release, there is a new accessibility property called accessibilityUserInputLabels which takes an array of strings that a user can use as an alternative name for the UI element. Here’s what it looks like in action:

view.accessibilityUserInputLabels = ["Starbucks"]

Shortened transaction labels

Much cleaner! 🙌 Now, as you can see, voice control users can use the shortened name to access the table view cell.

You might be asking: well, now it looks like there are a bunch of duplicate names. How will it know which one to select? Say, for instance, I say “Tap Starbucks.” Voice control will then highlight all the instances of “Starbucks” it finds on the screen with a number and prompt the user to say which number they want to navigate to. Pretty snazzy 👌

One last thing to note is that if you decide to add more than one name in the accessibilityUserInputLabels array, the name overlay will only show the first one so be sure to list the one you anticipate users using the most up front. However, if there are other common names a user might use, then this is the place to add it. Like all accessibility features, there’s no guarantee that a user will have name overlays on so they’re going to pick the most intuitive name for them to use.

Are you planning to implement voice control for your app? Have you encountered any other cool voice control features? I’d love to hear from you about your own accessibility journey 😊

1 thought on “Adopting Voice Control”

Leave a Reply