The importance of accessibility for your iOS app

Leave no one behind

David García Alhambra
New Work Development
5 min readJun 26, 2023

--

Accessibility on apps is the practice of designing apps that are usable by people with different abilities and preferences.

As an iOS developer, it’s important to create apps that are accessible to everyone, regardless of their abilities. Besides being the right thing to do, it also expands your user base and make your app more appealing to a wider audience.

This is not a code or tech article; it’s intended as a nudge to start identifying any accessibility issues your app might have. I’ve also included a bunch of tools to help you with that, and I recommend you make a list of points you find interesting so you can start exploring and implementing them in your own lovely app.

Let’s get started! 🚀

Accessibility icon surrounded by other iOS icons.

Identify colour contrast issues 🎨

One common accessibility issue is a lack of contrast between text and background colours. This can make it difficult for users with low vision to read content in your app. To fix this issue, you can review your app’s color contrast and make sure it meets accessibility standards.

There are several online tools you can use to check your app’s colour contrast, such as the WebAIM Contrast Checker. To use the tool, enter the foreground and background colors for your UI elements and it will provide you with a contrast ratio. Ideally, your app’s contrast ratio should be at least 4.5:1 for normal text and 3:1 for large text.

This images shows the difference between a text with high contrast and one with low contrast. Shows light and dark mode variants.
Image from designcode.io

Adjust font sizes 📏

While some users might have perfect vision, others may rely on assistive technologies or have specific visual impairments. In such cases, the ability to adjust the font size is key to a comfortable and enjoyable user experience. This is where Dynamic Text comes into play. By offering the flexibility to increase or decrease the font size, Dynamic Text lets users with low vision or other visual impairments to customise their reading experience to suit their individual needs.

A user who can effortlessly read and navigate your app is more likely to engage with its content and features, in turn to increase user satisfaction and retention.

Implementing Dynamic Text in an iOS application is relatively straightforward. Apple’s developer guidelines provide comprehensive documentation on integrating Dynamic Text throughout the app’s interface, ensuring that text elements automatically adjust their size based on the user’s preferred settings.

If you use SwiftUI you can easily preview how your app will look in different scenarios. At the bottom of your preview, select Variants > Dynamic Type variants to see something like this:

SwiftUI preview with Dynamic Type variants enabled.

Provide clear feedback 👀

In addition to visual impairments, it’s essential to consider the needs of users with cognitive disabilities when designing and developing your iOS app. These individuals may face challenges related to memory, attention, and comprehension, making it crucial to provide clear and effective feedback within your app.

This includes visual cues, such as displaying success messages or highlighting completed tasks, as well as auditory feedback through sounds or voice prompts. We can also enable haptic feedback using the great API that Apple provide us. Using a combination of visual, auditory and haptic cues helps accommodate all users, ensuring that they can comprehend and process information more effectively.

Let’s say you have a button that leads to a page with more information about your product. Instead of just changing the button colour when the user taps on it, you can also add a short message that says ‘Loading…’ to indicate that the action is being processed.

As well as immediate feedback, you should also consider providing error messages that are clear, concise, and easily understandable.

Support VoiceOver 🦻

One of the most important accessibility features on iOS is the VoiceOver tool. VoiceOver is a screen reader that provides audio descriptions of on-screen content, allowing users with visual impairments to navigate.

With VoiceOver activated, users can navigate an app using swipe gestures and double-tapping to activate buttons or links. VoiceOver also provides audio feedback when an action is performed, such as a button press or text field input.

Here, you can get started by documenting how VoiceOver should work in your app. Define groups of elements that must be read together and set traits, labels, values and hints for each element that needs them.

Trait: Constants that describe how an accessibility element behaves.

Label: A string that succinctly identifies the accessibility element.

Value: A string that represents the current value of the accessibility element.

Hint: A string that briefly describes the result of performing an action on the accessibility element.

The graphic bellow is an example of how I defined how VoiceOver should work in the You section on XING, the app I work on at New Work SE. The numbers show the order that VoiceOver should follow when reading the content. The yellow notes are the default behaviour, while the green ones are a custom element we should create.

You section of XING’s app with notes with all the traits, values, hints and labels that VoiceOver should read.

There are a lot of different points to cover here, so I’ll include them in a future post. In the meantime, you can check this documentation from Apple to find out more about this.

Testing your app’s accessibility 🧐

The final step to improve your app’s accessibility is to test it thoroughly. Here are a few things to keep in mind:

👀 Test with assistive technologies: Use assistive technologies like the Accessibility Inspector app to test your app’s accessibility. To open it, just click on Xcode > Open Developer Tool > Accessibility Inspector.

The Inspector pointer button will allow you to point a specific section on the screen to see the accessibility traits and values of that element.

The Audit button is also really useful as it lists all the issues it finds in the current view of your app.

An screenshot from the Accessibility Inspector with arrows pointing what is each button.
Accessibility Inspector

🕵️ Test with real users: Get feedback from users with disabilities to make that your app is truly accessible to everyone.

📱 Test across devices: Make sure you test your app’s accessibility on different devices and iOS versions to ensure compatibility.

Leave no one behind 🧏

Improving the accessibility of your iOS app is both important and a great way to expand your user base and provide a more inclusive app. There are a lot more ways to make sure your app is accessible, but by following the tips and techniques I’ve outlined in this article, you’ve already got a great starting point to create a more accessible and user-friendly app. So go ahead and give it a try! 🦾

Thanks for reading my post. You’ll also find me over on Twitter: @dev_alhambra.

🙇🏻

--

--