Show Your Humanity By Making iOS Apps Accessible

Apple takes accessibility very seriously for all their platforms to make sure all the iOS, macOS, tvOS and watchOS apps are usable for everyone including the people having disabilities. Unfortunately, every human being is not normal, some people have disabilities like vision Impairment, deafness, mental health conditions or physical disabilities. However, technology has grown so much that people having disabilities can do all sort of things that normal users do. They feel less disabled when technology helps them to make their lives happier. As an iOS application developer, we should also contribute to their lives with little efforts by making iOS apps accessible to everyone. In this post, we will see how to improve the accessibility of iOS apps to make apps accessible as well testable.

Apple Accessibility Technologies

Apple has done the lot of work so far by improving API that allows developers to make apps accessible. It takes very little of effort and a little bit of code to make apps accessible to everyone regardless of their needs.

Apple focuses on four major accessibility concerns and added assistive features, supporting tools and technologies to support users with those disabilities. The four areas include

  • Motor:

    Those users can’t push with force on screen or can’t accurately tap on target. Apple has added technologies like Switch Control and Dwell Control so that users can easily select and tap on the apps or area they are interested. Switch control is now available on all other Apple platforms as well.

  • Vision:

    Users who can not see properly or blind. Apple added technologies like Display Adjustment, Magnifiers so that users can use the phone camera to magnify the content on the screen.

  • Hearings:

    Users who are deaf or cannot hear. Apple has introduced software TTY technology inbuilt with iPhone so that users don’t need to use additional big hardware to use TTY.

  • Learnings:

    Users having mental health problems or conditions like dyslexia and autism. Apple has enhanced the typing feedback for users having learning disabilities.

On top of this, Apple has improved the Accessibility API a lot that we will cover later in this post. Apple is investing a lot in Accessibility so that their apps can be used for everyone including people with disability and want you to make apps which are accessible too.

Why Are Accessibility Considerations Often Ignored?

There are some companies who take Accessibility very seriously e.g like Apple, British Broadcasting Corporation and some other government websites but it common that accessibility considerations are often ignored by the most of the other organisations. I don’t know the real reasons but the potential reasons I can think of are

  • The most e-commerce businesses don’t  consider accessibility aspect because they only target a certain audience.
  • Business cannot justify buying for doing accessibility-related features.
  • Development team don’t understand technical aspects of accessibility and its importance.
  • Developers feel additional work or burden to implement accessibility features in the apps
  • Do you think any other reasons?

It is totally fine if implementing accessibility features takes days or weeks to implement but what about if a line or a couple of lines of code makes someone’s lives easy? you should definitely do this for disabled users. If you are deliberately ignoring accessibility then you are not human, you are lazy bast*rd. Apple has provided clean Accessibility APIs that can be easily used for making apps accessible.

Audit App for Accessibility

In order to make the iOS app accessible, you need to know the accessibility flaws in your app. Once you know what needs to be improved then you can fix that using Apple’s accessibility API. So how do we know that our Apps has accessibility issues or not? The old way to check for accessibility was to turn on the VoiceOver and navigate to every screen of the app and note the issues. However, this is the very time-consuming process. Apple has launched the new tool called “Accessibility Inspector”. You should definitely watch WWDC 2016 video on Auditing iOS App for Accessibility to know more about Accessibility Inspector. I will cover its practical use in later posts. An Accessibility Inspector helps us to audit our iOS app within few minutes and highlights all the issues within an app. Once we know about the issues then we can fix issues using the awesome Accessibility API provided by Apple.

Common Accessibility Issues

The audit report for accessibility should give list of the flaws in iOS app but some of the common problems that we usually see those are

  • Missing Accessibility Labels for the UI elements like buttons, labels, images etc
  • Missing Accessibility Identifiers for the UI elements like buttons, labels, images etc
  • Poor design without considering colour and fonts
  • Dynamic Font issues
  • Non localised accessibility labels

There might be some more issues but common issues that I can think of are mentioned above.

Use Accessibility APIs

Apple’s UIKit framework has standard accessibility baked in so that we don’t have to do additional work to fix the accessibility issues. We just have to provide the correct accessibility information for the each and every UI element that we are declaring in our iOS apps. We can easily fix accessibility issues found during the audit using a UIAccessibility protocol which has a lot of methods to deal with all possible issues. We can make our app accessible by implementing methods of UIAccessibility protocol. Now let’s highlight some of the properties and methods and how we can use those to make app accessible.

isAccesibilityElement

The UIAccessibility protocol has property   isAccessibileElement: Bool  which determines whether the element should be exposed to assertive technology like VoiceOver. We can set this property true for the elements that help users to assist with more information. e.g for the background image of UIView we can set it to false however for the logo we can set it to true so that user will know that its logo on the screen. Assuming we have image view with name logoImage and backgroundImage in our app, we can use this property like this.

accessibilityLabel

The UIAccessibility protocol has another property accessibilityLabel: String which is being read by the assistive technologies like VoiceOver. It’s a succinct label that identifies the accessibility element, in a localized string. One of the common mistake that we forget to localise this property.  We should localise this value per language so that users from the different country will hear accessibility information in their own languages. e.g we have hellolabel that say hello if we add accessibility information something like this

The voice over will read it as “Hello” even though app language and locale is French. I am sure French people would like to hear “Bonjour” rather than “Hello”. We should use localised strings in that case that will make voice over read hello in different languages. You can achieve that writing simple String extension and use the localised values form translations string for all labels. You can find sample GitHub project here for reference.

accessibilityIdentifier

There is another very important instant property for property accessibilityIdentifier  which allows us to uniquely identify a UI element on the screen. The documentation can b found here. This property is super important to make our app testable for Xcode UI Test a.k.a XCUITest. You can  We can add accessibility Identifier for helloLable using

accessibilityTraits

The UIAccessibility protocol has another property which characterises the accessibility element. We can provide trains for buttons, images, adjustable etc. You can read more about traits here. In order to add UIAccessibility trait to button helloButton, we can use

accessibilityValue

The UIAccessibility protocol has another property accessibilityValue: String which is being used for determining the value of an element at certain state e.g  slider, picker wheel etc. We can add value to mySlider using

There some other API that can be used for the custom views but we are good if we use above API properly thought the app.

Benefits of Making App Accessible

The question is why you would want to make your app accessible. What are the other benefits of making app accessible apart from helping disabled people? Here are some quick benefits

  • Adding Accessibility makes iOS apps usable for everyone
  • Voice over users can benefit from their local languages
  • Adding accessibility Identifier makes app testable by XCUITest which speeds up the testing process.
  • Xcode UI Tests became stable and concrete t provide early feedback during app development

Conclusion

This is the short post to convince iOS Developers, Designers and everyone involved in iOS team to take accessibility seriously and make lives of disabled people much easier. Although QA guys are not physically disabled, adding accessibility identifiers make their lives easy as well. Accessibility is for everyone and remembers that accessibility is humanity. Be human!