Accessibility live region on iOS
A live region allows users of assistive technologies to receive updates whenever important information on the screen changes.
On iOS, the closest thing to live regions are elements with the
updatesFrequently trait. When an element is focused, label and value changes are announced periodically.
You can replicate a live region by posting accessibility announcements. To replicate 'polite' behavior, you can set
false. To be 'asssertive', set the value to
For even more advanced behavior, you can use act on
// Periodic announcements (only on focus!) element.accessibilityTraits = .updatesFrequently // Replicate live region let message = NSAttributedString( string: "Appt live region", attributes: [.accessibilitySpeechQueueAnnouncement: true] ) UIAccessibility.post(notification: .announcement, argument: message)