Declaration
compose().textInputAutocapitalization(
autocapitalization: SwiftUI.TextInputAutocapitalization | null
)nonisolated func textInputAutocapitalization(
_ autocapitalization: TextInputAutocapitalization?
) -> some ViewParameters
autocapitalization*SwiftUI.TextInputAutocapitalization | nullOne of the capitalizing behaviors
Discussion
Use textInputAutocapitalization(_:) when you need to automatically
capitalize words, sentences, or other text like proper nouns.
In example below, as the user enters text the shift key is automatically enabled before every word:
TextField("Last, First", text: $fullName)
.textInputAutocapitalization(.words)The TextInputAutocapitalization struct defines the available
autocapitalizing behavior. Providing nil to this view modifier does
not change the autocapitalization behavior. The default is
TextInputAutocapitalization.sentences.
defined in the TextInputAutocapitalization struct or nil.
See also
More in Text and symbols.
- allowsTighteningSets whether text in this view can compress the space between characters when necessary to fit text in a line.
- autocorrectionDisabledSets whether to disable autocorrection for this view.
- baselineOffsetSets the vertical offset for the text relative to its baseline in this view.
- boldApplies a bold font weight to the text in this view.
- findDisabledPrevents find and replace operations in a text editor.
- findNavigatorProgrammatically presents the find and replace interface for text editor views.
- fontSets the default font for text in this view.
- fontDesignSets the font design of the text in this view.
- fontWeightSets the font weight of the text in this view.
- fontWidthSets the font width of the text in this view.
- interactionActivityTrackingTagSets a tag that you use for tracking interactivity.
- italicApplies italics to the text in this view.