Skip to content

Instantly share code, notes, and snippets.

@lucianoschillagi
Created December 19, 2023 11:21
Show Gist options
  • Save lucianoschillagi/5e78121d4b2a7631461f3eba28674dcf to your computer and use it in GitHub Desktop.
Save lucianoschillagi/5e78121d4b2a7631461f3eba28674dcf to your computer and use it in GitHub Desktop.
Voice Over will read the Text "Hello Accesibility"
import SwiftUI
struct AccesibilityText: View {
var body: some View {
ZStack {
Color.mint.opacity(0.7).ignoresSafeArea()
VStack {
Text("Hello, Accessibility!")
.font(.largeTitle)
.padding()
.foregroundColor(.white)
.background(Color.black)
.cornerRadius(10)
// Voice Over will read this text 🗣️
.accessibilityValue("Hello, Accessibility!")
}
.padding()
}
}
}
#Preview {
AccesibilityText()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment