Focus
Identify and control which visible object responds to user interaction.
Overview
Focus indicates which element in the display receives the next input. Use view modifiers to indicate which views can receive focus, to detect which view has focus, and to programmatically control focus state.
[Image]
For design guidance, see Focus and selection in the Human Interface Guidelines.
Topics
Essentials
Indicating that a view can receive focus
Managing focus state
focused(_:equals:)focused(_:)isFocusedFocusStateFocusedValueEntry()FocusedValueKeyFocusedBindingsearchFocused(_:)searchFocused(_:equals:)