ios-swiftui-accessibility-techniques  by cvs-health

Enhancing iOS accessibility with SwiftUI patterns and analysis

Created 2 years ago
361 stars

Top 77.6% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a comprehensive resource for iOS developers to implement and test accessibility in SwiftUI applications. It offers live, testable code examples demonstrating both correct and incorrect accessibility patterns, alongside a static analysis tool to identify common issues, aiming to help developers meet WCAG standards and improve user experience for assistive technology users.

How It Works

The project showcases a wide array of accessibility techniques through practical SwiftUI code examples, allowing developers to see good and bad implementations side-by-side. It also includes a11y-check, a static analysis tool that scans Swift source files for accessibility violations, such as missing labels, incorrect traits, and inadequate touch target sizes, aligning its checks with WCAG 2.2 guidelines.

Quick Start & Requirements

The a11y-check tool can be installed via Homebrew after cloning the repository (brew tap cvs-health/ios-swiftui-accessibility-techniques file://$PWD && brew install --HEAD cvs-health/ios-swiftui-accessibility-techniques/a11y-check). Alternatively, it can be built from source using Swift 5.9+ and macOS 13+ (git clone ... && cd .../A11yAgent && swift build). Once installed, run a11y-check . from your app's project folder. Further details are available in A11yAgent/README.md.

Highlighted Details

  • Features a11y-check, a static analysis tool for SwiftUI accessibility issues, aligned with WCAG 2.2.
  • Demonstrates over 50 accessibility techniques in SwiftUI, including Actions, Dynamic Type, Touch Target Size, and Meaningful Accessible Names.
  • Provides live, testable "good and bad" code examples for VoiceOver and other assistive technologies.
  • Includes an MCP server for integration with Cursor chat for on-demand accessibility checks.

Maintenance & Community

This project is sponsored by CVS Health. A contributor guide is available, requiring a signed Contributor License Agreement (CLA) before contributions. No direct links to community channels like Discord or Slack were provided in the README.

Licensing & Compatibility

Licensed under the Apache License, Version 2.0. This permissive license allows for commercial use and integration with closed-source projects.

Limitations & Caveats

The documentation indicates that "Siri Shortcuts" is a technique that has not yet been completed within the project's scope. Building the static analysis tool from source requires specific versions of Swift and macOS.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
53 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.