Instance Method インスタンスメソッド

textContentType(_:)

Sets the text content type for this view, which the system uses to offer suggestions while the user enters text on macOS. テキスト内容型をこのビューに対して設定します、それはシステムが提案を申し出るために使います、ユーザがテキストをmacOS上で入力する間に。

Declaration 宣言

func textContentType(_ textContentType: NSTextContentType?) -> some View

Parameters パラメータ

textContentType

One of the content types available in the NSTextContentType structure that identify the semantic meaning expected for a text-entry area.

Discussion 議論

Use this method to set the content type for input text. For example, you can configure a TextField for the entry of a username:


TextField("Enter your username", text: $username)
    .textContentType(.username)

See Also 参照

Configuring Text Entry