TextInputDictationBehavior
A behavior that determines whether a search field offers dictation, and what starts it.
Declaration
struct TextInputDictationBehaviorOverview
Pass a value of this type to the searchDictationBehavior(_:) modifier. Search fields use automatic unless you choose otherwise.
The following example keeps the dictation microphone in the search field, but waits for someone to select it before listening:
NavigationStack {
RecipeList(matching: query)
}
.searchable(text: $query)
.searchDictationBehavior(.inline(activation: .onSelect))On visionOS you can remove the microphone from the field entirely with preventDictation.