TechnologiesSwiftUIAccessibility

AccessibilityTechnologies struct

iOSmacOStvOSwatchOSvisionOSiOS 15.0+✓ renders

Accessibility technologies available to the system.

How it works

AccessibilityTechnologies describes the set of assistive technologies — such as VoiceOver or Switch Control — that may be interacting with a view. Because a user can have more than one assistive technology engaged at once, the type models a *set* of options rather than a single mode, letting you tailor behavior or presentation to the specific tools in play. Reach for it when you need to know which assistive technologies are active so your view can adapt to them, for example when SwiftUI hands you a value in an accessibility-related context.

  1. Treat it as an option set

    AccessibilityTechnologies conforms to OptionSet, so a value is a collection of flags rather than one case. You can build a value from an array literal of its members, as in let active: AccessibilityTechnologies = [.voiceOver, .switchControl], which represents both technologies being active simultaneously.

  2. Reference individual technologies as static members

    Each supported assistive technology is exposed as a static option you compose into a set. Here .voiceOver and .switchControl name the two technologies of interest; you spell them with leading-dot syntax because the contextual type is already AccessibilityTechnologies.

  3. Test membership with contains(_:)

    Inherited from OptionSet, contains(_:) answers whether a given technology is part of the set. The example branches on active.contains(.voiceOver) and active.contains(.switchControl) to decide which systemImage each Label should show, so the row reflects whether that specific tool is engaged.

  4. Combine and refine sets with set algebra

    Being an OptionSet, values support union(_:), intersection(_:), insert(_:), and remove(_:), so you can merge or filter technologies without manual bit work. This lets you derive a value — for instance the technologies common to two contexts — and then drive your view from the result the same way active drives the Labels here.

Try it — Drop .switchControl from the active literal so it reads [.voiceOver], and watch the Switch Control Label's systemImage fall back to "circle" while VoiceOver stays checked.

Example & preview

Press Run live & edit to compile it in your browser — then edit the Swift on the left and the preview re-renders live.

AccessibilityTechnologies.swift
struct AccessibilityTechnologiesDemo: View {
    let active: AccessibilityTechnologies = [.voiceOver, .switchControl]

    var body: some View {
        VStack(alignment: .leading, spacing: 8) {
            Text("Assistive Tech")
                .font(.headline)
            Label("VoiceOver", systemImage: active.contains(.voiceOver) ? "checkmark.circle.fill" : "circle")
            Label("Switch Control", systemImage: active.contains(.switchControl) ? "checkmark.circle.fill" : "circle")
        }
        .padding()
    }
}
Live preview
Assistive Tech VoiceOver Switch Control
Assistive Tech VoiceOver Switch Control
swift → lexer → parser → sema → uiir → canvas Open in Studio ↗
What's new in SwiftUI 27 →