One of the capitalizing behaviors defined in the Text
struct or nil.
Instance Method
インスタンスメソッド
text
textInputAutocapitalization(_:)
Sets how often the shift key in the keyboard is automatically enabled.
Availability 有効性
- iOS 15.0+
- iPadOS 15.0+
- Mac Catalyst 15.0+
- tvOS 15.0+
- watchOS 8.0+
Technology
- Swift
UI
Declaration 宣言
func textInputAutocapitalization(_ autocapitalization: TextInputAutocapitalization
?) -> some View
Parameters パラメータ
autocapitalization
Input Autocapitalization
Discussion 議論
Use text
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 Text
struct defines the available autocapitalizing behavior. Providing nil
to this view modifier does not change the autocapitalization behavior. The default is Text
.