TextInputDictationActivation
A configuration that determines what starts dictation in a search field.
Declaration
type TextInputDictationActivation = 'onLook' | 'onSelect';struct TextInputDictationActivationPass a literal, or build one with SwiftUI.TextInputDictationActivation from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'onLook'SwiftUI.TextInputDictationActivation.onLookA configuration that activates dictation when someone selects the microphone or looks at the entry field.
'onSelect'SwiftUI.TextInputDictationActivation.onSelectA configuration that activates dictation when someone selects the microphone.
Overview
Pass a value of this type to
TextInputDictationBehavior.inline(activation:) when you want to keep the
dictation microphone in a search field but choose how someone begins
speaking:
NavigationStack {
RecipeList(matching: query)
}
.searchable(text: $query)
.searchDictationBehavior(.inline(activation: .onLook))On visionOS, TextInputDictationActivation.onLook starts dictation as
soon as someone looks at the field. Choose
TextInputDictationActivation.onSelect instead when speaking early would
be disruptive.
From Apple’s SwiftUI documentation. Code samples there are Swift.
See also
More in Text and symbols.
- DisabledTextSelectabilityA selectability type that disables text selection by the person using your app.
- EnabledTextSelectabilityA selectability type that enables text selection by the person using your app.
- FindContextThe status of the find navigator for views which support text editing.
- FixedTextVariantThe default text variant preference that chooses the largest available variant.
- FontAn environment-dependent font.
- FontChainFont with chained calls: SwiftUI.Font.bold(...).
- FontContextInformation used to resolve a font.
- FontDesignA design to use for fonts.
- FontLeadingA line spacing adjustment that you can apply to a font.
- FontWeightA weight to use for fonts.
- FontWidthA width to use for fonts that have multiple widths.
- SubmitLabelA semantic label describing the label of submission within a view hierarchy.