Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

appt-org/accessibility-ios

Repository files navigation

Accessibility

Version License Platform

The purpose of this library is to provide a unified way for accessibility features on Android on iOS.

All accessibility methods are available through the Accessibility class. Additionally, an accessibility property is added to all classes which inherit from UIView and UIViewController.

Example:

Providing an accessibility label:

  • on Android you would set contentDescription
  • on iOS you would set accessibilityLabel

With this library you can can use accessibility.label on Android and iOS. The library calls the native methods.

Features

  • UIView
    • label: set the accessibility label
    • action: set the accessibility action to announce
    • elements: set the order of accessibility elements
    • focus(): moves the accessibility focus to this view
  • UIViewController
    • elements: set the order of accessibility elements
    • announce(message): announces the provided message

Requirements

Minimum supported iOS version is 12.0

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Accessibility is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Accessibility'

The module has been renamed to Appt, because iOS 15 uses the Accessibility namespace.

import Appt

Author

Jan Jaap de Groot, janjaap@appt.nl

License

Accessibility is available under the MIT license. See the LICENSE file for more info.