Reputation: 781
I have a simple app to announce a text when tapping a button. Here is the code (it's in SwiftUI but the same behavior arises using UIKit)
struct ContentView: View {
var body: some View {
VStack(spacing: 20) {
Text("Test accessibility")
.font(.largeTitle)
Spacer()
Button {
let attributedMessage: NSAttributedString = NSAttributedString(
string: "Test accessibility announcement",
attributes: [
.accessibilitySpeechQueueAnnouncement: true
]
)
UIAccessibility.post(notification: .announcement, argument: attributedMessage)
} label: {
Text("Test accessibility button")
}
Spacer()
}
}
}
There are two behaviors:
Here you can see it (first waiting VoiceOver to read the full accessibility info and then double tapping while accessibility info is being read).
Why the announcement is not read in the first case?
Setting accessibilitySpeechQueueAnnouncement to false instead of true provokes the announcement not being read in any case.
Upvotes: 2
Views: 311