swiftui-accessibility
Accessibility implementation guide for SwiftUI apps. Use when implementing VoiceOver support, adding accessibilityLabel/Hint/Value, supporting Dynamic Type, ensuring color contrast, testing accessibility, or reviewing accessibility in PRs. Covers iOS accessibility APIs, WCAG guidelines, and testing tools.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
SwiftUI Accessibility Guide
SwiftUIアプリのアクセシビリティ実装ガイド。
ディレクトリ構成
swiftui-accessibility/
├── SKILL.md (このファイル)
└── references/
└── accessibility.md
リファレンスファイル
references/accessibility.md
アクセシビリティ実装ガイド:
-
VoiceOver対応:
- accessibilityLabel: 要素の説明
- accessibilityHint: 操作のヒント
- accessibilityValue: 現在の値
- accessibilityTraits: 要素の種類
-
Dynamic Type:
- フォントスケーリング
- レイアウト対応
-
色のコントラスト:
- WCAG基準
- ダークモード対応
-
モーション:
- reduceMotion対応
- アニメーション代替
-
テストとツール:
- Accessibility Inspector
- VoiceOverテスト方法
使用方法
アクセシビリティ実装時
-
references/accessibility.mdで実装パターンを確認 - VoiceOverでテスト
- Dynamic Typeでレイアウト確認
PRレビュー時
- アクセシビリティラベルの有無を確認
- 画像にaltテキストがあるか確認
- タップ領域が十分か確認
クイック実装ガイド
VoiceOver基本
// ラベル(必須)
Image(systemName: "heart.fill")
.accessibilityLabel("お気に入り")
// ヒント(操作説明)
Button("削除") { }
.accessibilityHint("この項目を削除します")
// 値(現在の状態)
Slider(value: $volume)
.accessibilityValue("\(Int(volume))パーセント")
Dynamic Type対応
// 推奨: システムフォント
Text("Hello")
.font(.body)
// カスタムフォントのスケーリング
Text("Hello")
.font(.custom("MyFont", size: 16, relativeTo: .body))
reduceMotion対応
@Environment(\.accessibilityReduceMotion) var reduceMotion
var body: some View {
content
.animation(reduceMotion ? nil : .default, value: isExpanded)
}
チェックリスト
- 全てのインタラクティブ要素にaccessibilityLabelがあるか
- 画像に適切な説明があるか
- Dynamic Typeでレイアウトが崩れないか
- 色だけに依存した情報伝達がないか
- タップ領域は44pt以上あるか
関連スキル
- swiftui-coding-guidelines: 基本的なベストプラクティス
- swiftui-code-review-checklist: PRレビュー時のアクセシビリティチェック
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!