accessibilityFocused

Modifies this view by binding its accessibility element's focus state to the given boolean state value.

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

Overloads

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

React
compose().accessibilityFocused(
  condition: SwiftUI.AccessibilityFocusStateBinding
)
Swift
nonisolated func accessibilityFocused(
    _ condition: AccessibilityFocusState<Bool>.Binding
) -> some View

Parameters

  • The accessibility focus state to bind. When accessibility focus moves to the accessibility element of the modified view, the focus value is set to true. If the value is set to true programmatically, then accessibility focus will move to accessibility element of the modified view. The value will be set to false if accessibility focus leaves the accessibility element of the modified view, and accessibility focus will be dismissed automatically if the value is set to false programmatically.

Return value

The modified view.

See also

More in Accessibility.