From ios-swift-skills
Provides best practices and SwiftUI code examples for iOS accessibility, including VoiceOver labels, Dynamic Type support, touch targets, and HIG compliance.
npx claudepluginhub fal3/claude-skills-collection --plugin ios-swift-skillsThis skill uses the workspace's default tool permissions.
This skill focuses on making iOS applications accessible to all users, including those with visual, motor, or cognitive impairments. It covers VoiceOver, Dynamic Type, and adherence to Apple's Human Interface Guidelines (HIG) for accessibility.
Applies platform accessibility best practices to SwiftUI, UIKit, and AppKit code, covering VoiceOver, Dynamic Type, Reduce Motion, and all Nutrition Label categories. Ensures a11y from first draft in UI writing, editing, or review.
Routes iOS accessibility diagnostics and audits for VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, and App Store reviews.
Implements, reviews, or improves accessibility in iOS/macOS apps with SwiftUI and UIKit, covering VoiceOver, focus management, Dynamic Type, custom rotors, and XCTest testing.
Share bugs, ideas, or general feedback.
This skill focuses on making iOS applications accessible to all users, including those with visual, motor, or cognitive impairments. It covers VoiceOver, Dynamic Type, and adherence to Apple's Human Interface Guidelines (HIG) for accessibility.
VoiceOver Support: Ensure all UI elements are properly labeled and navigable with VoiceOver.
Dynamic Type: Support text scaling for users with visual impairments.
Color and Contrast: Use sufficient color contrast and don't rely solely on color to convey information.
Touch Targets: Make interactive elements large enough (44x44 points minimum).
HIG Compliance: Follow Apple's accessibility guidelines throughout the design and development process.
Testing: Regularly test with accessibility features enabled.
User Prompt: "How do I add VoiceOver labels to SwiftUI buttons?"
Expected Output:
import SwiftUI
struct AccessibleButtonView: View {
var body: some View {
VStack {
Button(action: {
// Action
}) {
Image(systemName: "star.fill")
.font(.largeTitle)
}
.accessibilityLabel("Favorite this item")
.accessibilityHint("Double tap to add to favorites")
Button("Submit", action: {
// Submit action
})
.accessibilityHint("This will send your information")
}
}
}
User Prompt: "Implement Dynamic Type in a SwiftUI text view."
Expected Output:
import SwiftUI
struct DynamicTextView: View {
var body: some View {
VStack {
Text("This text scales with Dynamic Type")
.font(.body)
Text("Headline that adapts")
.font(.headline)
Text("Custom font that scales")
.font(.system(size: 17, weight: .regular, design: .default))
.minimumScaleFactor(0.8)
.lineLimit(1)
}
.padding()
}
}
User Prompt: "Create an accessible login form in UIKit with VoiceOver support."
Expected Output:
import UIKit
class LoginViewController: UIViewController {
let emailTextField = UITextField()
let passwordTextField = UITextField()
let loginButton = UIButton(type: .system)
override func viewDidLoad() {
super.viewDidLoad()
// Email field
emailTextField.placeholder = "Email"
emailTextField.keyboardType = .emailAddress
emailTextField.accessibilityLabel = "Email address"
emailTextField.accessibilityHint = "Enter your email address"
// Password field
passwordTextField.placeholder = "Password"
passwordTextField.isSecureTextEntry = true
passwordTextField.accessibilityLabel = "Password"
passwordTextField.accessibilityHint = "Enter your password"
// Login button
loginButton.setTitle("Log In", for: .normal)
loginButton.accessibilityHint = "Tap to log in to your account"
// Layout code here...
}
}
User Prompt: "How to group related accessibility elements in SwiftUI?"
Expected Output:
import SwiftUI
struct GroupedElementsView: View {
var body: some View {
VStack {
VStack {
Text("Contact Information")
.font(.headline)
TextField("Name", text: .constant(""))
TextField("Phone", text: .constant(""))
}
.accessibilityElement(children: .combine)
.accessibilityLabel("Contact information form")
Button("Save Contact") {
// Save action
}
.accessibilityHint("Saves the contact information")
}
.padding()
}
}
User Prompt: "Ensure good color contrast and provide alternatives for color-dependent information."
Expected Output:
import SwiftUI
struct ColorAccessibleView: View {
@State private var isSelected = false
var body: some View {
VStack {
// Good contrast example
Text("Important Message")
.foregroundColor(.white)
.background(Color.black)
.padding()
// Color + shape indicator
HStack {
Circle()
.fill(isSelected ? Color.green : Color.red)
.frame(width: 20, height: 20)
Text(isSelected ? "Online" : "Offline")
}
.accessibilityElement(children: .combine)
.accessibilityLabel(isSelected ? "Status: Online" : "Status: Offline")
Button(action: { isSelected.toggle() }) {
Text("Toggle Status")
}
.accessibilityHint("Changes the online status indicator")
}
}
}