accessibilityRespondsToUserInteraction

Explicitly set whether this Accessibility element responds to user interaction and would thus be interacted with by technologies such as Switch Control, Voice Control or Full Keyboard Access.

View ModifieriOS 15.0+macOS 12.0+tvOS 15.0+watchOS 8.0+

Overloads

2 ways to call compose().accessibilityRespondsToUserInteraction(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().accessibilityRespondsToUserInteraction(
  respondsToUserInteraction?: boolean
)
Swift
nonisolated func accessibilityRespondsToUserInteraction(
    _ respondsToUserInteraction: Bool = true
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>

Parameters

  • respondsToUserInteractionboolean

Discussion

If this is not set, the value is inferred from the traits of the Accessibility element, the presence of Accessibility actions on the element, or the presence of gestures on the element or containing views.

See also

More in Accessibility.