VoiceOver & Label Aksesibilitas
Jelaskan kontrol untuk teknologi asistif.
VoiceOver & Label Aksesibilitas adalah pelajaran SwiftUI Academy gratis di CoddyKit. Ini adalah pelajaran 1 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar SwiftUI Academy, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus SwiftUI Academy mencakup 4 pelajaran total.
Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.
What Is VoiceOver?
VoiceOver is Apple's screen reader. It speaks your interface aloud so people who can't see the screen can still use your app. 🔊
SwiftUI Helps You
The good news: SwiftUI auto-generates accessibility for standard views. A Text already reads its content, so you start ahead.
When Labels Go Missing
An icon-only button has no readable text, so VoiceOver may say nothing useful. That's when you add an explicit accessibility label.
Button(action: save) {
Image(systemName: "square.and.arrow.down")
}Adding a Label
Attach accessibilityLabel to describe what a control does in plain words, not how it looks.
Button(action: save) {
Image(systemName: "square.and.arrow.down")
}
.accessibilityLabel("Save")Label, Not Appearance
Write the label as the user's goal. Say Save, not "down arrow icon". The label is meaning, never decoration.
Adding Hints
An accessibilityHint tells the user what happens after they act. It is read after the label, with a short pause.
.accessibilityLabel("Save")
.accessibilityHint("Saves your note to the list")Reading the Value
For controls that hold data, accessibilityValue announces the current state, like a slider reading "70 percent".
Slider(value: $level)
.accessibilityValue("\(Int(level)) percent")Grouping Elements
Use accessibilityElement(children:) to merge a card's pieces into one swipe, so VoiceOver reads it as a single unit.
VStack { Text(name); Text(role) }
.accessibilityElement(children: .combine)Marking Roles with Traits
Add accessibilityAddTraits so VoiceOver announces a view's role, like calling a tappable card a button.
.accessibilityAddTraits(.isButton)Hiding Decoration
Purely decorative images add noise. Use accessibilityHidden(true) to skip them so VoiceOver focuses on what matters.
Image("sparkle")
.accessibilityHidden(true)Test It Yourself
Turn on VoiceOver in the Accessibility settings and swipe through your app. Hearing it is the fastest way to spot gaps.
Quick Check
You have an icon-only button. Which modifier gives VoiceOver a readable name?
Recap
You learned to make controls speak: add an accessibilityLabel for icons, hints for outcomes, and group or hide views so VoiceOver flows clearly. ✨
Pertanyaan yang Sering Diajukan
Apakah pelajaran “VoiceOver & Label Aksesibilitas” gratis?
Ya — teks lengkap “VoiceOver & Label Aksesibilitas” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus SwiftUI Academy, upgrade ke CoddyKit PRO. Kursus SwiftUI Academy mencakup 4 pelajaran total.
Apa yang akan aku pelajari di “VoiceOver & Label Aksesibilitas”?
Jelaskan kontrol untuk teknologi asistif. Kamu berlatih SwiftUI Academy dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.
Apakah aku perlu pengalaman untuk memulai SwiftUI Academy?
Tidak diperlukan pengalaman sebelumnya. SwiftUI Academy di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 1 dari 4.
Berapa lama pelajaran “VoiceOver & Label Aksesibilitas” memakan waktu?
Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.
Bisakah aku menulis dan menjalankan kode dalam pelajaran SwiftUI Academy ini?
Ya. Setiap pelajaran SwiftUI Academy menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.
Semua pelajaran dalam kursus ini
- VoiceOver & Label Aksesibilitas
- Dynamic Type & Font Berskala
- Melokalkan String & Katalog String
- Beradaptasi dengan Mode Terang & Gelap