Specifies if the view is focusable and, if so, adds an action to perform when the view comes into focus.
SDKs
- macOS 10.15+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Swift
UI
Declaration
Parameters
isFocusable
A Boolean value that indicates whether this view is focusable.
onFocusChange
A closure that’s called whenever this view either gains or loses focus. The Boolean parameter to
on
isFocus Change true
when the view is in focus; otherwise, it’sfalse
.
Return Value
A view that sets whether a view is focusable, and triggers on
when the view gains or loses focus.