Use text
instead.
Instance Method
インスタンスメソッド
autocapitalization(_:)
Sets whether to apply auto-capitalization to this view.
自動キャピタライゼーションをこのビューに適用すべきかどうかを設定します。
Deprecated 非推奨
Availability 有効性
- iOS 13.0–15.4 Deprecated
- iPadOS 13.0–15.4 Deprecated
- Mac Catalyst 13.0–15.4 Deprecated
- tvOS 13.0–15.4 Deprecated
Technology
- Swift
UI
Declaration 宣言
func autocapitalization(_ style: UITextAutocapitalizationType
) -> some View
Parameters パラメータ
style
One of the autocapitalization modes defined in the
UIText
enumeration.Autocapitalization Type
Discussion 議論
Use this method when you need to automatically capitalize words, sentences, or other text like proper nouns.
In example below, as the user enters text each word is automatically capitalized:
TextField("Last, First", text: $fullName)
.autocapitalization(UITextAutocapitalizationType.words)
The UIText
enumeration defines the available capitalization modes. The default is UIText
.