iOS SwiftUI Accessibility

Enforce WCAG 2.2 accessibility patterns in SwiftUI source code.

366|38|Updated Dec 1, 2023
One-click install
npx skills add https://github.com/cvs-health/ios-swiftui-accessibility-techniques --skill ios-swiftui-accessibility
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iOS SwiftUI Accessibility
Source: https://github.com/cvs-health/ios-swiftui-accessibility-techniques/tree/main
Command: npx skills add https://github.com/cvs-health/ios-swiftui-accessibility-techniques --skill ios-swiftui-accessibility

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of accessibility defects being discovered late in the development lifecycle, which increases rework costs and delays releases. It provides developers with immediate, actionable guidance to ensure SwiftUI applications meet WCAG 2.2 standards during the coding process.

Core Features & Use Cases

  • WCAG 2.2 Compliance: Enforces 37 specific rules covering labels, traits, dynamic type, contrast, and focus management.
  • Real-time Guidance: Offers immediate feedback on accessibility gaps, such as missing labels on buttons or insufficient touch target sizes.
  • Use Case: When building a new feature, use this Skill to verify that all custom interactive elements have appropriate accessibility traits and labels, ensuring the app is fully navigable by VoiceOver users from the start.

Quick Start

Use the iOS SwiftUI Accessibility skill to audit the current view for WCAG 2.2 compliance and suggest necessary accessibility modifiers.

Frequently Asked Questions about iOS SwiftUI Accessibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check my SwiftUI code for WCAG 2.2 compliance?

To check SwiftUI code for WCAG 2.2 compliance, audit your Swift source files to verify the presence of accessibility labels, traits, and dynamic type scaling. This enforces 37 specific static analysis rules covering focus management and touch targets.

What SwiftUI accessibility modifiers are required for VoiceOver navigation?

Required SwiftUI accessibility modifiers for VoiceOver include accessibility labels and traits for interactive elements. Applying these modifiers ensures custom buttons and controls are fully navigable and announced correctly by assistive technologies.

Can I use static analysis to enforce iOS accessibility traits and dynamic type scaling?

Yes, you can use static analysis to enforce iOS accessibility traits and dynamic type scaling. This process evaluates Swift source code against strict WCAG 2.2 standards to identify missing labels or insufficient touch target sizes.

Does this WCAG 2.2 auditing approach work with watchOS applications?

Yes, this WCAG 2.2 auditing approach works with watchOS applications. The static analysis applies to the development of both iOS and watchOS platforms requiring strict adherence to accessible coding patterns.

When should I run an accessibility audit on my SwiftUI views?

You should run an accessibility audit on your SwiftUI views during the development process when building a new feature. This provides immediate feedback on accessibility gaps, preventing defects late in the lifecycle and reducing rework costs.

Why does my SwiftUI custom button fail VoiceOver accessibility checks?

Your SwiftUI custom button fails VoiceOver accessibility checks if it lacks appropriate accessibility traits and labels. Static analysis identifies these missing modifiers, ensuring elements meet WCAG 2.2 standards for assistive technology navigation.