Accessibility/ADA testing in iOS

What are the advantages of Accessibility?

  • It’s easier for functional and UI testing
  • Everyone can use your app, including people with vision, learning or hearing disabilities.

How you test ADA in phone?

  1. Go to Settings -> Accessibility -> VoiceOver.
  2. Turn on VoiceOver
  3. Run your app.
  4. VoiceOver speaks the contents of the element

How to use app when Voice Over is on?

  • Single-tap anywhere on the screen : voice over reads the data
  • Single-swipe right: Move to next element on the screen
  • Single-swipe left: Move to previous element on the screen.
  • Double tap: To select the element.

How can you implement accessibility?

Five properties of Accessibility Attributes:

  1. Label: is the way to identify the control or view. Some examples are Back button and Hi welcome to accessibility app
  2. Traits: These describe the element’s state, behaviour or usage. Some examples are .none, .button, .header, .isSelected
  3. Hint: Describes the action an element completes. For example: Tap on button to change colour
  4. Frame: The frame of the element within the screen, in the format of a CGRect. VoiceOver speaks the contents of the CGRect.
  5. Value: The value of an element. For example, with a progress bar or a slider, the current value might read: 20 out of 25

How can you disable accessibility for a view?

How to test accessibility in simulator?

  1. Open accessibility inspector: Xcode -> Open Developer Dool -> Accessibility Inspector as shown in fig.1
  2. Run your app
  3. Change Accessibility Inspector target to simulator as shown in fig2.
fig.1 : accessibility inspector and fig2: changing target

3 different tabs in Accessibility Inspector:

  1. Inspection Detail pane
  2. Inspector Audit
  3. Settings

1. Inspection Detail pane:

  • Basic: Displays the attribute properties for the currently-highlighted element.
  • Actions: Lets you perform actions like tapping a button or scrolling the view. Pressing the Perform button in this pane will perform the action on your target.
  • Element: Displays the class, address and controller of the current item.
  • Hierarchy: Shows the view hierarchy for the element, making it easier to understand complex views.

2. Inspector Audit:

  • Click the Suggest Fixes icon, which looks like question mark in a circle against each warning and the inspector will offer suggestions about how to fix the issue. You can act on these suggestions later.
  • Click the Eye icon to take a snapshot of the app. This is useful for anyone who needs to create bug reports.

3. Additional Inspector Settings

  1. Invert colors: To preview what your interface looks like with dark and light theme. This is useful for people with light sensitivities, poor vision and colour blindness.
  • If you want to change background colour of view or text in dark and light theme, create new color set in xcassets
  • If you want to change images in dark and light theme, create new image set in xcassets
  • Then add the following code to change appearance according to theme change.
Color set for label text color and view background color
code for changing colour with theme selected
new viewcontroller is present after tapping on a button.Second view transparency change with reduce transparency accessibility
code for updating view transparency if isreduceTransparency enabled/disabled
  • Screen transitions and effects use the dissolve effect instead of zoom or slide effects.
  • Parallax effect where your wallpaper, apps, and alerts that move or shift slightly as you tilt your device are disabled.
  • Animation and effects in certain apps are disabled.
Animate and show label when button is tapped and reduce motion accessibility is not enabled
Disable animation if reduced motion is enabled.
dynamic font change
code for dynamic font change

How can you test all these feature in phone?

  1. Go to Settings -> Accessibility
  2. Under accessibility -> Turn on setting which is required to test
  3. Run your app.
  4. Check the changes.




iOS Developer in walmart

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

SwiftUI Tutorial: Working with List using ForEach

[iOS]Expense Tracker. Part 1. UI design

Create a Map & Show user’s location | Xcode 12, Swift 5.3

Introduction to MVVM with SwiftUI and Combine

Dexie 3.0.3 is out

Differences between designing Android and iOS native apps

Introduction to Swift UI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manasa M P

Manasa M P

iOS Developer in walmart

More from Medium

Build an iOS app with NotificationCenter

Introduction to Swift UI

Swift vs Objective-C: The Ideal Choice For iOS App Development

Everyone can code Puzzles — Hypocycloid