Skip to main content
Logo Appt Light

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 accessibilitySpeechQueueAnnouncement to false. To be 'asssertive', set the value to true.

For even more advanced behavior, you can use act on announcementDidFinishNotification events.

// 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)

Feedback?

Let us know!