Refine VoiceOver experience on your data-rich apps with Custom Content API

Sahil Sharma
2 min readSep 9, 2022

--

We think of VoiceOver when we think of accessibility. VoiceOver is most used accessibility feature among all other accessibility features available on iPhone device, but it could be overwhelming when VoiceOver read out labels on a data-rich app. Apple solved this problem with new Custom Content API introduced with iOS 14.0.

Apple’s Official Overview:

“The Custom Content API is useful for delivering accessibility information from complex data sets to your users in measured portions. Using this API allows you to leverage assistive technologies to present only the accessible content your app’s users need, when they need it.”

Let’s first see what’s the VoiceOver experience without using Custom Content API. I have a demo app created that shows the properties available for rent.

As you can see in the video, that’s was a lot of content for VoiceOver to read out. When a user navigating our app interface with VoiceOver

# Too much data may overwhelm

# Too little data will result in an incomplete experience

Custom Content API finds a perfect balance between these two extreme situations by delivering content to the user in measured portions. This API leverage assistive technology to present only the content your app users need when required.

Implementation

To implement Accessibility we first import Accessibility framework and add AXCustomContentProvider Protocol to our TableViewCell class

Next, we need to override accessibilityLabel property to return the most relevant details when user taps on the TableViewCell.

We then implement AXCustomContentProvider protocol method accessibilityCustomContent with an array of AXCustomContent objects. This array to be returned in the order you want VoiceOver to present them to the user. Let’s stitch all the pieces together.

PropertyCell.swift link

You can find full source code link below.

Note: AXCustomContent object provides importance property which I used for rent with value high. VoiceOver will always read out all high importance objects when the element is on focus.

Before we I show the your final result, lets enable MoreContent rotor on your iPhone so VoiceOver can indicate when More Content is available.

Setting up device

Enable More Content rotor on your iPhone device

  1. Go to Settings > Accessibility > Voice Over
  2. Tap Verbosity
  3. Tap More Content, and Select “Speak”, “Play Sound”, and “Change Pitch”

Now, user can just swipe up & down when “More Content Available” is spoken out by VoiceOver.

Final Result

Now, let’s see how our demo app looks when used Custom Content API.

Github Source Code:

https://github.com/ssharma0312/AXCustomContentProvider.git

Sources:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Unlisted

--

--

Sahil Sharma
Sahil Sharma

Written by Sahil Sharma

QA Automation | iOS Developer | SDET - I love coding, reading, health & fitness, and travelling.

No responses yet

Write a response