Agent skills for iOS, iPadOS, Swift, SwiftUI, and modern Apple framework development.
80
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Advisory
Suggest reviewing before use
Accessibility patterns for audio and video content using AVFoundation.
AVFoundation uses media characteristics to identify accessibility tracks:
Docs: AVMediaCharacteristic
| Characteristic | Purpose |
|---|---|
.transcribesSpokenDialogForAccessibility | Captions/SDH — transcribes dialog for deaf or hard of hearing users |
.describesMusicAndSoundForAccessibility | Captions that include descriptions of music and sound effects |
.describesVideoForAccessibility | Audio descriptions — narrates visual content for blind or low-vision users |
.easyToRead | Simplified captions for cognitive accessibility |
.containsOnlyForcedSubtitles | Subtitles that display only when content differs from the device language |
.languageTranslation | Subtitles providing a language translation |
import AVFoundation
let asset = AVURLAsset(url: videoURL)
let group = try await asset.load(.mediaSelectionGroup(forMediaCharacteristic: .legible))
if let group {
// Find the closed caption option
let ccOptions = AVMediaSelectionGroup.mediaSelectionOptions(
from: group.options,
with: .transcribesSpokenDialogForAccessibility
)
if let ccOption = ccOptions.first {
let playerItem = AVPlayerItem(asset: asset)
playerItem.select(ccOption, in: group)
}
}let adGroup = try await asset.load(.mediaSelectionGroup(forMediaCharacteristic: .audible))
if let adGroup {
let adOptions = AVMediaSelectionGroup.mediaSelectionOptions(
from: adGroup.options,
with: .describesVideoForAccessibility
)
if let adOption = adOptions.first {
playerItem.select(adOption, in: adGroup)
}
}AVPlayer automatically selects captioned/described tracks when the user enables these in Settings → Accessibility → Subtitles & Captioning. You don't need manual selection unless providing a custom media selection UI.
Check user preferences:
import MediaAccessibility
let captioningEnabled = MACaptionAppearanceIsDisplayedAutomatically(.user)SwiftUI's VideoPlayer inherits AVPlayer's automatic accessibility track
selection:
import AVKit
import SwiftUI
struct AccessibleVideoView: View {
let player: AVPlayer
var body: some View {
VideoPlayer(player: player)
.accessibilityLabel("Training video")
.accessibilityHint("Double-tap to play or pause")
}
}When building custom video controls, ensure:
accessibilityValue to announce time positionButton(action: toggleCaptions) {
Image(systemName: captionsEnabled ? "captions.bubble.fill" : "captions.bubble")
}
.accessibilityLabel(captionsEnabled ? "Captions on" : "Captions off")
.accessibilityHint("Toggles closed captions").tessl-plugin
skills
accessorysetupkit
references
activitykit
references
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
references
audioaccessorykit
references
authentication
references
avkit
references
background-processing
references
browserenginekit
references
callkit
references
carplay
references
cloudkit
references
contacts-framework
references
core-bluetooth
references
core-data
core-motion
references
core-nfc
references
coreml
references
cryptokit
references
cryptotokenkit
references
debugging-instruments
device-integrity
references
dockkit
references
energykit
references
eventkit
references
financekit
references
focus-engine
gamekit
references
healthkit
references
homekit
references
ios-accessibility
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
mapkit
metrickit
references
musickit
references
natural-language
references
paperkit
references
passkit
references
pdfkit
references
pencilkit
references
permissionkit
references
photokit
push-notifications
realitykit
references
relevancekit
references
scenekit
references
sensorkit
references
speech-recognition
references
spritekit
references
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
references
swift-codable
references
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-uikit-interop
swiftui-webkit
tabletopkit
references
tipkit
references
vision-framework
weatherkit
references
widgetkit
references