SuperAPI AI Directory

swiftui-accessibility

General & other

View repository

Updated 10-16 08:38

About this skill

SwiftUI Accessibility Guide

SwiftUI app accessibility implementation guide.

Directory structure

swiftui-accessibility/
├── SKILL.md (このファイル)
└── references/
    └── accessibility.md

Reference files

references/accessibility.md

Accessibility implementation guide:

  • VoiceOver support:
    • accessibilityLabel: description of the element
    • accessibilityHint: hint for the operation
    • accessibilityValue: current value
    • accessibilityTraits: type of element
  • Dynamic Type:
    • Font scaling
    • Layout support
  • Color contrast:
    • WCAG standards
    • Dark mode support
  • Motion:
    • reduceMotion support
    • Animation alternatives
  • Testing and tools:
    • Accessibility Inspector
    • How to test with VoiceOver

Usage

When implementing accessibility

  1. references/accessibility.md: check implementation patterns
  2. Test with VoiceOver
  3. Check layout with Dynamic Type

During PR review

  1. Check whether accessibility labels are present
  2. Check whether images have alt text
  3. Check whether tap areas are sufficient

Quick implementation guide

VoiceOver basics

// ラベル(必須)
Image(systemName: "heart.fill")
    .accessibilityLabel("お気に入り")

// ヒント(操作説明)
Button("削除") { }
    .accessibilityHint("この項目を削除します")

// 値(現在の状態)
Slider(value: $volume)
    .accessibilityValue("\(Int(volume))パーセント")

Dynamic Type support

// 推奨: システムフォント
Text("Hello")
    .font(.body)

// カスタムフォントのスケーリング
Text("Hello")
    .font(.custom("MyFont", size: 16, relativeTo: .body))

reduceMotion support

@Environment(\.accessibilityReduceMotion) var reduceMotion

var body: some View {
    content
        .animation(reduceMotion ? nil : .default, value: isExpanded)
}

Checklist

  • Do all interactive elements have an accessibilityLabel?
  • Do images have appropriate descriptions?
  • Does the layout break with Dynamic Type?
  • Is there no information conveyed by color alone?
  • Are tap areas 44pt or larger?

Related skills

  • swiftui-coding-guidelines: basic best practices
  • swiftui-code-review-checklist: accessibility check during PR review