textContentType(_:)
Sets the text content type for this view, which the system uses to offer suggestions while the user enters text on a watchOS device.
Declaration
nonisolated func textContentType(_ textContentType: WKTextContentType?) -> some View
Parameters
- textContentType:
One of the content types available in the Wktextcontenttype structure that identify the semantic meaning expected for a text-entry area. These include support for email addresses, location names, URLs, and telephone numbers, to name just a few.
Discussion
Use this method to set the content type for input text. For example, you can configure a TextField for the entry of email addresses:
TextField("Enter your email", text: $emailAddress)
.textContentType(.emailAddress)See Also
Managing text entry
autocorrectionDisabled(_:)autocorrectionDisabledkeyboardType(_:)scrollDismissesKeyboard(_:)textContentType(_:)textInputAutocapitalization(_:)TextInputAutocapitalizationtextInputCompletion(_:)textInputSuggestions(_:)textInputSuggestions(_:content:)textInputSuggestions(_:id:content:)textContentType(_:)textContentType(_:)TextInputFormattingControlPlacement