<!--
{
  "availability" : [
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKInterfaceTextField/setTextContentType(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKInterfaceTextField(im)setTextContentType:"
  },
  "title" : "setTextContentType(_:)"
}
-->

# setTextContentType(_:)

Sets the text field’s semantic meaning.

```
func setTextContentType(_ textContentType: WKTextContentType?)
```

## Parameters

`textContentType`

The text field’s content type. Passing `nil` clears the content type. For a list of possible content types, see [`WKTextContentType`](/documentation/WatchKit/WKTextContentType).

## Discussion

The text field’s content type modifies how the text input controller and Apple Continuity Keyboard behave.

- The input controller provides suggestions for [`oneTimeCode`](/documentation/WatchKit/WKTextContentType/oneTimeCode) content types, when available.
- The input controller displays a number pad for [`telephoneNumber`](/documentation/WatchKit/WKTextContentType/telephoneNumber), [`creditCardNumber`](/documentation/WatchKit/WKTextContentType/creditCardNumber), [`oneTimeCode`](/documentation/WatchKit/WKTextContentType/oneTimeCode), and [`postalCode`](/documentation/WatchKit/WKTextContentType/postalCode) content types.
- The input controller disables dictation for [`password`](/documentation/WatchKit/WKTextContentType/password) and [`newPassword`](/documentation/WatchKit/WKTextContentType/newPassword) content types.
- The Apple Continuity Keyboard autofills data based on the content type. To share login credentials from your web page, set up an associated domain for your watchOS app.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)